An Azure service that provides an event-driven serverless compute platform.
Thank you for reaching out to Microsoft Q&A.
When an Azure Function is triggered through a schedule (Timer Trigger) and remains in a running or stuck state, but the same function completes successfully when triggered manually from the Azure portal, the issue is typically related to runtime behavior and execution context differences, not the function code itself. Scheduled executions run automatically on the Azure Functions host and are subject to conditions such as cold starts, locked or overlapping timer executions, storage lease dependencies, long-running operations, or dependency access delays. Manual executions from the portal usually run on a warm and already-initialized instance, which is why the function completes successfully when started manually but not when triggered automatically.
Refer below points to resolve this issue or this is the workaround:
Cold start or function app not warmed up
- Timer-triggered functions may run on a cold instance, especially on Consumption or Flex plans.
- Manual execution from the portal warms up the function app first, allowing faster startup and completion.
- Heavy startup logic (SDK initialization, database connections, Key Vault access) can cause scheduled runs to appear stuck. Workaround: Enable Always On (if using an App Service plan) and minimize startup logic.
Previous timer execution is stuck or overlapping
- Timer triggers rely on a storage-based monitor to ensure only one execution runs at a time.
- If a previous execution did not finish cleanly, future scheduled runs will wait indefinitely. Check configuration in
host.json:{ "extensions": { "timers": { "useMonitor": - Review Application Insights logs to confirm whether an earlier execution is still running.
Long running or blocking execution logic
- Long-running operations, synchronous blocking calls, or infinite waits can prevent the runtime from marking execution as completed.
- Manual runs may succeed because the app is already warm and executes faster. Workaround: Ensure the function exits cleanly and consider using Durable Functions or a queue-triggered pattern for long-running tasks.
Dependency or Managed Identity access issues
- Scheduled triggers run fully under the function app’s managed identity and runtime permissions.
- Manual runs may succeed due to cached tokens or previously established connections. Check and validate: Managed Identity permissions, Key Vault access, storage access, and external service availability.
Azure Storage lease or connectivity issues
- Timer triggers depend on Azure Storage (via
AzureWebJobsStorage) for scheduling and execution locking. - Storage throttling, firewall rules, private endpoints, or DNS issues can cause the trigger to hang. Workaround: Verify storage connectivity, firewall/network rules, and review storage diagnostics.
Function timeout configuration
- On Consumption or Flex plans, exceeding execution time limits may stop the function before completion.
- Manual runs may complete due to reduced startup overhead. Check in
host.json:{ "functionTimeout": "00:10:00" }