cloud config_error ai_generated true

Microsoft.Azure.WebJobs.Extensions.Storage: The value for 'AzureWebJobsStorage' is missing or empty. Please set this app setting before running the function.

ID: cloud/azure-function-app-storage-connection-string-invalid

Also available as: JSON · Markdown · 中文
92%Fix Rate
87%Confidence
1Evidence
2023-08-20First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
Azure Functions runtime v4 active
Azure Functions Core Tools 4.0.5801 active
Azure CLI 2.56.0 active

Root Cause

The Azure Functions runtime requires a valid storage account connection string in the 'AzureWebJobsStorage' application setting to manage triggers, logs, and state. This error occurs when the setting is missing, empty, or points to an invalid storage account.

generic

中文

Azure Functions 运行时需要在 'AzureWebJobsStorage' 应用程序设置中提供有效的存储帐户连接字符串,以管理触发器、日志和状态。当该设置缺失、为空或指向无效存储帐户时会出现此错误。

Official Documentation

https://learn.microsoft.com/en-us/azure/azure-functions/functions-app-settings#azurewebjobsstorage

Workarounds

  1. 95% success Add a valid storage account connection string to the function app's application settings using Azure CLI: 'az functionapp config appsettings set --name MyFunctionApp --resource-group MyResourceGroup --settings AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net"'
    Add a valid storage account connection string to the function app's application settings using Azure CLI: 'az functionapp config appsettings set --name MyFunctionApp --resource-group MyResourceGroup --settings AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net"'
  2. 85% success Verify the storage account exists and is accessible by testing the connection string locally using Azure Storage Explorer or the 'az storage blob list' command.
    Verify the storage account exists and is accessible by testing the connection string locally using Azure Storage Explorer or the 'az storage blob list' command.

中文步骤

  1. Add a valid storage account connection string to the function app's application settings using Azure CLI: 'az functionapp config appsettings set --name MyFunctionApp --resource-group MyResourceGroup --settings AzureWebJobsStorage="DefaultEndpointsProtocol=https;AccountName=mystorageaccount;AccountKey=mykey;EndpointSuffix=core.windows.net"'
  2. Verify the storage account exists and is accessible by testing the connection string locally using Azure Storage Explorer or the 'az storage blob list' command.

Dead Ends

Common approaches that don't work:

  1. 60% fail

    Azure Functions requires a general-purpose v2 storage account (standard or premium). Using a premium block blob account without the correct endpoint format can cause the same error.

  2. 100% fail

    The setting is mandatory for the runtime to function. Without it, the function app cannot start.