question

Basil-4238 avatar image
0 Votes"
Basil-4238 asked dattatrayMharanur-8656 answered

Azure Function Time Trigger stops firing after a few days

I have configured a python time-trigger azure function app that triggers every 5 mins. It works fine but then after about 2 days it stops firing and never fires again. After this I re-built it and the same thing happened again. What is going on?

Here are some of the logs at the time it stops (oldest from bottom):

8/24, 7:29:03 AM - TRACE
0 functions loaded
Severity level:Information

8/24, 7:29:03 AM - TRACE
Loading functions metadata
Severity level:Information

8/24, 7:29:03 AM - TRACE
0 functions loaded
Severity level:Information

8/24, 7:29:03 AM - TRACE
Loading functions metadata
Severity level:Information

8/24, 7:28:38 AM - TRACE
Host lock lease acquired by instance ID '0000000000000000000000001AD908BE'.
Severity level:Information

8/24, 7:28:33 AM - TRACE
Job host started
Severity level:Information

8/24, 7:28:33 AM - TRACE
Host started (16ms)
Severity level:Information

8/24, 7:28:33 AM - TRACE
Host initialized (16ms)
Severity level:Information

8/24, 7:28:33 AM - TRACE
Initializing function HTTP routes No HTTP routes mapped
Severity level:Information

8/24, 7:28:33 AM - TRACE
HttpOptions { "DynamicThrottlesEnabled": false, "EnableChunkedRequestBinding": false, "MaxConcurrentRequests": -1, "MaxOutstandingRequests": -1, "RoutePrefix": "api" }

Severity level:Information
8/24, 7:28:33 AM - TRACE
No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).

Severity level:Warning
8/24, 7:28:33 AM - TRACE
Generating 0 job function(s)

Severity level:Information
8/24, 7:28:33 AM - TRACE
0 functions loaded

Severity level:Information
8/24, 7:28:33 AM - TRACE
FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:powershell

Severity level:Information
8/24, 7:28:33 AM - TRACE
FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:node

Severity level:Information
8/24, 7:28:33 AM - TRACE
FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:java

Severity level:Information
8/24, 7:28:33 AM - TRACE
Loading functions metadata

Severity level:Information
8/24, 7:28:33 AM - TRACE
Starting Host (HostId=nsolo-warmer, InstanceId=987272dd-75e7-4de2-ac39-a07df7c37fa4, Version=3.1.4.0, ProcessId=62, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=~3)

Severity level:Information
8/24, 7:28:33 AM - TRACE
Starting JobHost

Severity level:Information
8/24, 7:28:33 AM - TRACE
SingletonOptions { "LockPeriod": "00:00:15", "ListenerLockPeriod": "00:01:00", "LockAcquisitionTimeout": "10675199.02:48:05.4775807", "LockAcquisitionPollingInterval": "00:00:05", "ListenerLockRecoveryPollingInterval": "00:01:00" }

Severity level:Information
8/24, 7:28:33 AM - TRACE
FunctionResultAggregatorOptions { "BatchSize": 1000, "FlushTimeout": "00:00:30", "IsEnabled": true }

Severity level:Information
8/24, 7:28:33 AM - TRACE
LoggerFilterOptions { "MinLevel": "None", "Rules": [ { "ProviderName": null, "CategoryName": null, "LogLevel": null, "Filter": "<AddFilter>b__0" }, { "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider", "CategoryName": null, "LogLevel": "None", "Fi…

Severity level:Information
8/24, 7:28:33 AM - TRACE
LoggerFilterOptions { "MinLevel": "None", "Rules": [ { "ProviderName": null, "CategoryName": null, "LogLevel": null, "Filter": "<AddFilter>b__0" }, { "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider", "CategoryName": null, "LogLevel": "None", "Fi…

Severity level:Information
8/24, 7:28:33 AM - TRACE
ApplicationInsightsLoggerOptions { "SamplingSettings": { "EvaluationInterval": "00:00:15", "InitialSamplingPercentage": 100.0, "MaxSamplingPercentage": 100.0, "MaxTelemetryItemsPerSecond": 20.0, "MinSamplingPercentage": 0.1, "MovingAverageRatio": 0.25, "SamplingPercentageDecreaseTimeout": "00:02:00", "SamplingPerce…

Severity level:Information
8/24, 7:28:33 AM - TRACE
Host initialization: ConsecutiveErrors=0, StartupCount=3, OperationId=fe6d962f-b171-4d4c-8a27-d23942579ea1

Severity level:Information
8/24, 7:28:33 AM - TRACE
Initializing Host. OperationId: 'fe6d962f-b171-4d4c-8a27-d23942579ea1'.

Severity level:Information
8/24, 7:28:33 AM - TRACE
Initializing Warmup Extension.

Severity level:Information
8/24, 7:28:33 AM - TRACE
FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:powershell

Severity level:Information
8/24, 7:28:33 AM - TRACE
FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:node

Severity level:Information
8/24, 7:28:33 AM - TRACE
FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language:java

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AnuragSingh-MSFT avatar image
0 Votes"
AnuragSingh-MSFT answered AnuragSingh-MSFT commented

Hi @Basil-4238,

Welcome to Microsoft Q&A!

The most common cause for Azure Functions not getting triggered is that triggers are not synced properly, mainly after updates or when you deploy your updates by referencing an external package. You can sync triggers in one of three ways:

  • Restart your function app in the Azure portal

  • Send an HTTP POST request to https://{functionappname}.azurewebsites.net/admin/host/synctriggers?code=<API_KEY> using the master key.

  • Send an HTTP POST request to https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP_NAME>/providers/Microsoft.Web/sites/<FUNCTION_APP_NAME>/syncfunctiontriggers?api-version=2016-08-01. Replace the placeholders with your subscription ID, resource group name, and the name of your function app.

More details available here: Trigger syncing

In case you are still facing this issue, the wiki article below should help to investigate it further - Investigating and reporting issues with timer triggered functions not firing

Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Basil-4238,
Following up if you got a chance to look into my answer. Let me know if you have any queries or concerns.

Please 'Accept as answer' if it helped so that it can help others in the community looking for help on similar topics.

0 Votes 0 ·
Basil-4238 avatar image
0 Votes"
Basil-4238 answered

The issue was resolved. I moved the time trigger function app to a new resource group and it seemed to solve it

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

dattatrayMharanur-8656 avatar image
0 Votes"
dattatrayMharanur-8656 answered

Always On: Keeps the app loaded even when there's no traffic. When Always On is not turned on (default), the app is unloaded after 20 minutes without any incoming requests. The unloaded app can cause high latency for new requests because of its warm-up time. When Always On is turned on, the front-end load balancer sends a GET request to the application root every five minutes. The continuous ping prevents the app from being unloaded.

Always On is required for continuous WebJobs or for WebJobs that are triggered using a CRON expression.

https://docs.microsoft.com/en-us/azure/app-service/configure-common

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

dattatrayMharanur-8656 avatar image
0 Votes"
dattatrayMharanur-8656 answered

Always On is required for continuous WebJobs or for WebJobs that are triggered using a CRON expression.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.