Azure Function App Only Runs When I Open the Azure Portal

Mohammed Sohel 66 Reputation points
2023-08-22T20:08:45.63+00:00

I have recently Created an Azure PowerShell Function from the portal. The function is setup to trigger every day at 4 PM. This works fine when I am logged in to the Portal but when In active in or if my laptop is shutdown, it does not trigger.

Below is the function.json,

{
  "bindings": [
    {
      "name": "Timer",
      "type": "timerTrigger",
      "direction": "in",
      "schedule": "0 0 16 * * *"
    }
  ]
}

Any help highly appreciated.

Thanks,

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,666 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,906 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,637 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JananiRamesh-MSFT 29,236 Reputation points
    2023-08-23T13:43:39.3066667+00:00

    Hi Mohammed Sohel Thanks for reaching out. One of the first things I'd recommend is to check is runOnStartup and make sure that is set to false.

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=python-v2%2Cin-process&pivots=programming-language-csharp#configuration

    This issue can happen if your Azure function is on consumption plan.

    To ensure that your Azure Function runs continuously and triggers at the scheduled time, you can switch to the App Service plan and configure the function app to run continuously. The App Service plan provides dedicated resources for your function app and allows you to run your function app continuously.

    Note: Please set Alwayson option ON under configuration blade.

    If you have any further query do let us know. I would be happy to help.

    Please do "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.