cloud config_error ai_generated true

Microsoft.Azure.WebJobs.Extensions.Storage:'AzureWebJobsStorage' 的值缺失或为空。请在运行函数前设置此应用设置。

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

其他格式: JSON · Markdown 中文 · English
92%修复率
87%置信度
1证据数
2023-08-20首次发现

版本兼容性

版本状态引入弃用备注
Azure Functions runtime v4 active
Azure Functions Core Tools 4.0.5801 active
Azure CLI 2.56.0 active

根因分析

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

English

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

官方文档

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

解决方案

  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.

无效尝试

常见但无效的做法:

  1. 60% 失败

    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% 失败

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