Azure Functions Failed to Start: Diagnosis and Fixes
Azure Functions failed to start errors prevent all functions in the app from executing. They can be caused by issues in the function code itself, missing configuration, storage connectivity problems, or corrupt deployment packages. Because the entire host fails to start rather than a single function, diagnosis requires working through several layers: host configuration, app settings, storage account connectivity, and the deployment package itself.
Symptom: what failure looks like
When a Function App fails to start you typically see one of these in the Azure portal or logs:
Microsoft.Azure.WebJobs.Script.WebHost.WebJobsScriptHostService: A host error has occurred during startup operation
System.InvalidOperationException: The host has not been fully configured yet.
-- or --
Function host is not running.
-- or --
Host Status: {
"id": "...",
"state": "Error",
"errors": [
"Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.MyFunction'. ..."
]
}In Application Insights, look for exceptions of type FunctionIndexingException, HostInitializationException, or any exception with “startup” in the stack trace in the 5-minute window around when the failure began.
Step 1: Verify required app settings are present
The most common cause of Functions startup failure is a missing app setting that the code expects to be present. Functions throw a startup exception when a required environment variable or Key Vault reference is not resolvable.
# List all app settings for the Function App
az functionapp config appsettings list \
--resource-group myRG \
--name myFunctionApp \
--query "[].{Key:name, Value:value}" \
--output table
# Add a missing app setting
az functionapp config appsettings set \
--resource-group myRG \
--name myFunctionApp \
--settings MyRequiredSetting=value AnotherSetting=value2
# Add a Key Vault reference instead of a plain value
az functionapp config appsettings set \
--resource-group myRG \
--name myFunctionApp \
--settings "MySecret=@Microsoft.KeyVault(SecretUri=https://mykeyvault.vault.azure.net/secrets/MySecret/)"Check that AzureWebJobsStorage is present and valid. Azure Functions requires this setting to connect to the storage account used for internal state (distributed locks, function state). If this setting is missing or the connection string is invalid, the host will not start.
Step 2: Verify storage account connectivity
Azure Functions relies on a storage account for its host lock, timer trigger state, and durable functions state. If the function app cannot reach the storage account, the host will not start.
# Check the current AzureWebJobsStorage setting
az functionapp config appsettings list \
--resource-group myRG \
--name myFunctionApp \
--query "[?name=='AzureWebJobsStorage'].value" \
--output tsv
# Verify the storage account exists and is accessible
STORAGE_ACCOUNT="mystorageacct"
az storage account show \
--name $STORAGE_ACCOUNT \
--resource-group myRG \
--query "{Name:name, Status:statusOfPrimary, NetworkRules:networkRuleSet.defaultAction}"
# Check if the storage account firewall is blocking the function app
# (If default action is Deny, the function app's IP or VNet must be in the allow list)
az storage account network-rule list \
--account-name $STORAGE_ACCOUNT \
--resource-group myRGIf the storage account uses a private endpoint or firewall rules, the function app must be VNet-integrated and the storage account’s private endpoint must be in a subnet the function app can reach. For Consumption plan function apps, VNet integration requires the Premium plan or deploying the app in a specific configuration.
Step 3: Validate host.json and function.json
A syntax error or invalid configuration value in host.json will prevent the host from starting. The error is usually logged but can be subtle.
# Download the current host.json from the Function App
az functionapp deployment source config-local-git \
--name myFunctionApp \
--resource-group myRG
# Or use the Kudu API to fetch the file
FUNC_APP_NAME="myFunctionApp"
curl -u '$myFunctionApp:DEPLOYMENT_PASSWORD' \
"https://$FUNC_APP_NAME.scm.azurewebsites.net/api/vfs/site/wwwroot/host.json"A valid minimal host.json for Functions v4 (.NET isolated) looks like this:
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}Common host.json errors: missing version field, invalid JSON (trailing comma, unquoted keys), extension bundle version range that does not resolve to any available bundle, or a logging level set to a value that causes excessive telemetry and throttling.
Step 4: Extension bundle resolution failures
Extension bundles provide triggers (Service Bus, Event Hubs, Cosmos DB) without requiring individual NuGet packages. If the extension bundle cannot be downloaded at startup, functions using those triggers will fail to index.
[2026-03-19 10:15:32] A host error has occurred:
Microsoft.Azure.WebJobs.Script: Failed to download extension bundle
from https://functionscdn.azureedge.net/public/ExtensionBundles/...
System.Net.Http.HttpRequestException: Connection refusedCauses: the function app’s outbound internet is blocked (by NSG, Azure Firewall, or user-defined routes), or the extension bundle CDN endpoint is temporarily unavailable. If outbound internet is blocked by design, use WEBSITE_RUN_FROM_PACKAGE with a pre-built package that includes all extensions compiled in, or configure extension bundle offline using a custom feed URL pointing to an internal mirror.
# Check if the Function App can reach the extension bundle CDN
# (Run from Kudu console or SSH into the function app)
curl -I "https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/index.json"
# If outbound access is blocked, pre-build extensions and use package deployment
# Set WEBSITE_RUN_FROM_PACKAGE to deploy a zip that includes all binaries
az functionapp config appsettings set \
--resource-group myRG \
--name myFunctionApp \
--settings WEBSITE_RUN_FROM_PACKAGE=1Step 5: Corrupt or incomplete deployment package
If the function app was deployed with a corrupt zip, a failed deployment, or is missing the function.json files (for out-of-process models), the host will start but find no functions to index, or will fail to load the worker process.
# Trigger a fresh deployment from source control
az functionapp deployment source sync \
--resource-group myRG \
--name myFunctionApp
# Restart the function app after a fresh deployment
az functionapp restart \
--resource-group myRG \
--name myFunctionApp
# Check deployment logs for errors
az functionapp log deployment show \
--resource-group myRG \
--name myFunctionApp
# List the files in the wwwroot via Kudu to verify deployment is complete
curl -u '$myFunctionApp:DEPLOYMENT_PASSWORD' \
"https://myFunctionApp.scm.azurewebsites.net/api/vfs/site/wwwroot/" \
--output -Step 6: Runtime version mismatch
A function app built for Functions v4 runtime will not start on a v1 or v2 runtime host. Check that the FUNCTIONS_EXTENSION_VERSION app setting matches the version your code targets.
# Check current runtime version
az functionapp config appsettings list \
--resource-group myRG \
--name myFunctionApp \
--query "[?name=='FUNCTIONS_EXTENSION_VERSION'].value" \
--output tsv
# Should return: ~4 for v4 (current stable)
# Set the correct runtime version
az functionapp config appsettings set \
--resource-group myRG \
--name myFunctionApp \
--settings FUNCTIONS_EXTENSION_VERSION=~4
# Check and set the language worker version (e.g., for .NET isolated)
az functionapp config appsettings set \
--resource-group myRG \
--name myFunctionApp \
--settings FUNCTIONS_WORKER_RUNTIME=dotnet-isolated \
DOTNET_VERSION=8.0Common mistakes
- Deploying local.settings.json to Azure. local.settings.json is intentionally excluded from deployments by .gitignore and the Functions deployment tooling. App settings must be configured manually in the Function App configuration blade or via az functionapp config appsettings set. A common symptom is that the function works locally but is missing environment variables in Azure.
- Not restarting the Function App after changing app settings. Many app setting changes (especially FUNCTIONS_EXTENSION_VERSION and FUNCTIONS_WORKER_RUNTIME) require a restart to take effect. Use az functionapp restart after making critical setting changes, or enable Always On if the Consumption plan cold-start behaviour is masking startup errors.
- Using an app setting name that conflicts with a reserved name. Azure Functions has a set of reserved app setting names (WEBSITE_, FUNCTIONS_, AZURE_*) that have specific meanings. Overwriting them with custom values can cause unexpected behaviour. Check the Azure Functions reserved environment variable list before naming new settings.
Summary
- Check Application Insights for startup exceptions in the 5-minute window around the failure — these show the root cause directly.
- Verify AzureWebJobsStorage is present, valid, and the function app can reach the storage account on the network.
- Validate host.json for syntax errors and ensure the extension bundle version range resolves to an available bundle.
- Match FUNCTIONS_EXTENSION_VERSION (~4) and FUNCTIONS_WORKER_RUNTIME to the values your code was built for.
- If the function app is in a VNet with restricted outbound access, use WEBSITE_RUN_FROM_PACKAGE with a pre-built package instead of relying on the extension bundle CDN.
Frequently asked questions
How do I see Azure Functions startup errors in the Azure portal?
Navigate to your Function App in the portal, go to Platform features > Log stream, or use the Monitor > Logs blade to query Application Insights. For startup errors specifically, check the "Function App Down or Reporting Errors" detector in the Diagnose and Solve Problems blade — it surfaces common startup failure patterns with guided remediation steps.
Why does my function app start locally but fail in Azure?
The most common reasons are: (1) App settings defined in local.settings.json are not present in the Function App configuration — local.settings.json is never deployed; (2) the Azure environment uses a managed identity for storage but local uses a connection string; (3) a package or dependency that is present locally is missing from the deployment package; (4) the runtime version in Azure does not match the local version. Compare the app settings and the runtime version between local and Azure.
What does "The host is not running" mean?
This message means the Azure Functions host process started but failed to initialise fully. Common causes include a syntax error in host.json, a missing extension bundle, a corrupt deployment package, or an unhandled exception thrown during startup in a static constructor or dependency injection configuration. Check Application Insights for exceptions logged in the last 5 minutes around the failure time.