|
| 1 | +--- |
| 2 | +title: Resolve Function App Down or Reporting Errors |
| 3 | +description: Describes how to troubleshoot an Azure Functions app if it's not responding or reports errors. |
| 4 | +ms.date: 08/05/2025 |
| 5 | +ms.reviewer: v-liuamson; v-gsitser, v-ryanberg |
| 6 | +ms.custom: sap:Function app down or reporting errors |
| 7 | +--- |
| 8 | + |
| 9 | +# Resolve "Function App Down or Reporting Errors" issues |
| 10 | + |
| 11 | +## Common scenarios, error messages, and symptoms |
| 12 | + |
| 13 | +Microsoft Azure Function App failures typically fit into three major categories: configuration issues, customer code issues, and platform issues. This article explores these issues in detail and introduces the appropriate diagnostic tools for troubleshooting. |
| 14 | + |
| 15 | +### Configuration issues |
| 16 | + |
| 17 | +These issues are the most common. They include: |
| 18 | + |
| 19 | +- Missing or incorrect application settings, such as `AzureWebJobsStorage`, `FUNCTIONS_WORKER_RUNTIME`, and binding-specific configurations. For more information, see the [App settings reference for Azure Functions](/azure/azure-functions/functions-app-settings). |
| 20 | +- Storage account misconfigurations, including deleted accounts, rotated keys, and firewall restrictions. For more information, see [Storage considerations for Azure Functions](/azure/azure-functions/storage-considerations?tabs=azure-cli). |
| 21 | +- Key Vault and Managed Identity access problems because of misconfigured permissions or missing identity assignments. For more information, see the following resources: |
| 22 | + - [Use Key Vault references as app settings - Azure App Service](/azure/app-service/app-service-key-vault-references?tabs=azure-cli#troubleshoot-key-vault-references) |
| 23 | + - [Create a function app without default storage secrets in its definition - Azure Functions](/azure/azure-functions/functions-identity-based-connections-tutorial) |
| 24 | + |
| 25 | +### Customer code issues |
| 26 | + |
| 27 | +These issues have the following causes: |
| 28 | + |
| 29 | +- Faulty code patterns that cause high CPU or memory usage, SNAT exhaustion, or runtime exceptions (for example, division by zero or null reference). |
| 30 | +- Long-running or inefficient functions that are especially problematic on consumption plans because of timeout constraints. |
| 31 | + |
| 32 | +For more information, see the following resources: |
| 33 | + |
| 34 | +- [Azure Functions best practices](/azure/azure-functions/functions-best-practices?tabs=csharp) |
| 35 | +- [Improve Azure Functions performance and reliability](/azure/azure-functions/performance-reliability) |
| 36 | +- [Manage connections in Azure Functions](/azure/azure-functions/manage-connections?tabs=csharp) |
| 37 | + |
| 38 | +### Platform issues |
| 39 | + |
| 40 | +These issues are less common but usually have a greater effect: |
| 41 | + |
| 42 | +- Unsupported runtime versions (for example, Azure Functions `~2.x` or `~3.x`). |
| 43 | +For more information, see the following resources: |
| 44 | + - [Azure Functions language stack support policy](/azure/azure-functions/language-support-policy?pivots=programming-language-csharp) |
| 45 | + - [Supported languages in Azure Functions](/azure/azure-functions/supported-languages?tabs=isolated-process%2Cv4&pivots=programming-language-csharp#languages-by-runtime-version) |
| 46 | + |
| 47 | +- Host startup failures, including placeholder site specialization errors and container allocation issues. |
| 48 | + |
| 49 | +### Typical error messages |
| 50 | + |
| 51 | +You might experience common errors such as the following: |
| 52 | + |
| 53 | +- **Azure Functions runtime is unreachable.** |
| 54 | + |
| 55 | + - See [Troubleshoot error: Azure Functions runtime is unreachable](/azure/azure-functions/functions-recover-storage-account). |
| 56 | + |
| 57 | +- **Function host not running.** |
| 58 | + |
| 59 | +- **Access Denied**: `'C:\home\site\wwwroot\host.json'`. |
| 60 | + |
| 61 | +- **HTTP 5*xx* errors**: 503, 502, 500, or timeouts. |
| 62 | + |
| 63 | +### Symptoms to watch for |
| 64 | + |
| 65 | +- Function not triggering or running. See [Analyze Azure Functions telemetry in Application Insights](/azure/azure-functions/analyze-telemetry-data#viewing-telemetry-in-monitor-tab). |
| 66 | + |
| 67 | +- Missing invocation history or unexpected gaps. |
| 68 | + |
| 69 | +- High resource consumption (CPU or memory spikes that are flagged by detectors). |
| 70 | + |
| 71 | +- Timeouts or long response times, especially on Consumption plans (maximum of 230 seconds). |
| 72 | + |
| 73 | +- Functions not listed on the overview page. |
| 74 | + |
| 75 | +## Diagnostic tools |
| 76 | + |
| 77 | +To identify and resolve issues, you can use the following tools in the Azure portal. |
| 78 | + |
| 79 | +### Function App Down or Reporting Errors (Preview) |
| 80 | + |
| 81 | +To access this tool, follow these steps: |
| 82 | + |
| 83 | +1. Sign in to the [Azure portal](https://portal.azure.com). |
| 84 | +1. Open **Function App**. |
| 85 | +1. Select **Diagnose and solve problems**. |
| 86 | +1. Search for **Function App Down or Reporting Errors (Preview)**. |
| 87 | + |
| 88 | +**Features of this tool** |
| 89 | + |
| 90 | +- Automates key troubleshooting checks by using existing detectors. |
| 91 | +- Provides minimal noise and focused root cause analysis. |
| 92 | +- Supports [conversational diagnostics](https://techcommunity.microsoft.com/blog/appsonazureblog/power-of-conversational-diagnostics-public-preview-diagnostic-workflows/428866ution). |
| 93 | + |
| 94 | +## Issue categories |
| 95 | + |
| 96 | +Function app downtime errors are categorized as follows. |
| 97 | + |
| 98 | +### Common configuration issues |
| 99 | + |
| 100 | +- Misconfigured application settings |
| 101 | +- Incorrect or unreachable storage account configuration |
| 102 | +- Key Vault access permission issues |
| 103 | +- Managed Identity authentication problems |
| 104 | +- Binding or trigger misconfiguration |
| 105 | +- Network connectivity issues |
| 106 | + |
| 107 | +### Code and runtime resource issues |
| 108 | + |
| 109 | +- High CPU or memory consumption |
| 110 | +- SNAT port exhaustion |
| 111 | +- TCP connection exhaustion |
| 112 | +- Long-running or stuck functions |
| 113 | +- Runtime exceptions and failures |
| 114 | +- Poor error handling or retry logic |
| 115 | + |
| 116 | +## Diagnostic checks performed |
| 117 | + |
| 118 | +The diagnostic workflow evaluates the following aspects of your function spp: |
| 119 | + |
| 120 | +- **General information** |
| 121 | + - Hosting plan type (Consumption, Premium, Dedicated, Flex) |
| 122 | + - Runtime version |
| 123 | + - Platform (Linux or Windows) |
| 124 | + - Trigger types and bindings |
| 125 | +- **Startup issues** |
| 126 | + - Diagnostic events during app startup |
| 127 | + - Offline history analysis for unexpected downtimes |
| 128 | +- **Recent deployments** |
| 129 | + - Highlights deployments that might have affected the app |
| 130 | +- **Runtime and language version validation** |
| 131 | + - Confirms use of supported versions |
| 132 | +- **Configuration checks** |
| 133 | + - Verifies mandatory app settings |
| 134 | + - Verifies Key Vault and Managed Identity configuration |
| 135 | + - Checks for SyncTrigger issues |
| 136 | + - Detects Function Host name collisions |
| 137 | +- **Extension versions** |
| 138 | + - Identifies outdated or unsupported extensions |
| 139 | +- **Hosting plan setup** |
| 140 | + - Analyzes configuration and scaling behavior |
| 141 | + - Checks for SNAT port exhaustion, high CPU, and memory issues |
| 142 | + - Includes risk alerts: |
| 143 | + - For Dedicated plans: verifies that **AlwaysOn** is enabled |
| 144 | + - For Elastic Premium: checks VNet routing and scaling |
| 145 | +- **Execution health** |
| 146 | + - Detects: |
| 147 | + - Execution failures |
| 148 | + - Nontriggering functions |
| 149 | + - Stuck or long-running executions |
| 150 | +- **AI-powered analysis** |
| 151 | + - Uses OpenAI to detect issue patterns and provide contextual recommendations |
| 152 | + |
| 153 | +### Application Insights queries |
| 154 | + |
| 155 | +For diagnostics, run these queries in Application Insights: |
| 156 | + |
| 157 | +- **Requests per worker (last 30 minutes):** |
| 158 | + |
| 159 | + ```kusto |
| 160 | + requests |
| 161 | + | where timestamp > ago(30m) |
| 162 | + | summarize count() by cloud_RoleInstance, bin(timestamp, 1m) |
| 163 | + | render timechart |
| 164 | + ``` |
| 165 | +
|
| 166 | +- **Traces for errors (last 30 minutes):** |
| 167 | +
|
| 168 | + ```kusto |
| 169 | + traces |
| 170 | + | where timestamp > ago(30m) |
| 171 | + | where customDimensions.LogLevel == "Error" |
| 172 | + ``` |
| 173 | +
|
| 174 | +- **Runtime exceptions (last 30 minutes):** |
| 175 | +
|
| 176 | + ```kusto |
| 177 | + exceptions |
| 178 | + | where timestamp > ago(30m) |
| 179 | + ``` |
| 180 | +
|
| 181 | +> [!NOTE] |
| 182 | +> Sampling is enabled by default. If it's necessary, disable this feature temporarily during an investigation. |
| 183 | +
|
| 184 | +For more information, see [Analyze Azure Functions telemetry in Application Insights](/azure/azure-functions/analyze-telemetry-data#viewing-telemetry-in-monitor-tab). |
| 185 | +
|
| 186 | +### Network validator tool |
| 187 | +
|
| 188 | +> [!NOTE] |
| 189 | +> This tool applies to all hosting plans, except for the Windows and Linux Consumption plans. |
| 190 | +
|
| 191 | +If your app shows errors such as `FAILED TO INITIALIZE RUN FROM PACKAGE.txt` or `host.json not found`, use the [network troubleshooter](../../app-service/troubleshoot-vnet-integration-apps.md#network-troubleshooter) to resolve the errors. |
| 192 | +
|
| 193 | +To access the tool, follow these steps: |
| 194 | +
|
| 195 | +1. Sign in to the [Azure portal](https://portal.azure.com). |
| 196 | +1. Navigate to **Diagnose and solve problems**. |
| 197 | +1. Search for **Connectivity Troubleshooter**. |
| 198 | +
|
| 199 | +This tool checks for: |
| 200 | +
|
| 201 | +- DNS resolution |
| 202 | +- Storage and Key Vault access |
| 203 | +- Outbound restrictions (VNet, NSG, firewalls) |
| 204 | +
|
| 205 | +When you use the network validator, make sure that: |
| 206 | +
|
| 207 | +- VNet integration is correctly configured. |
| 208 | +- No endpoint or firewall blocks are in place. |
| 209 | +
|
| 210 | +For more information, see the following resources: |
| 211 | +
|
| 212 | +- [Azure Functions networking options](/azure/azure-functions/functions-networking-options?tabs=azure-portal#troubleshooting) |
| 213 | +- [Frequently asked questions about networking in Azure Functions](/azure/azure-functions/functions-networking-faq) |
| 214 | +
|
| 215 | +### Kudu logs (SCM) |
| 216 | +
|
| 217 | +> [!NOTE] |
| 218 | +> This tool applies to all hosting plans, except for the Linux Consumption and Flex Consumption plans. |
| 219 | +
|
| 220 | +For information about how to access and use Kudu logs (SCM), see [Access Kudu for your app](/azure/app-service/resources-kudu#access-kudu-for-your-app). |
| 221 | +
|
| 222 | +### Other logs |
| 223 | +
|
| 224 | +- **Host Logs**: `%HOME%\LogFiles\Application\Functions\Host` |
| 225 | +- **Functions log**: `%HOME%\LogFiles\Application\Functions\Function\<your_triggername>` |
| 226 | +- **System-level log**: `%HOME%\LogFiles\Eventlog.xml` |
| 227 | +
|
| 228 | +For more information, see [Understanding the Azure App Service file system](https://github.com/projectkudu/kudu/wiki/understanding-the-azure-app-service-file-system). |
0 commit comments