尝试创建 docker 容器功能应用程序,当我这样做时 docker 运行 收到错误 "Storage not defined"
Trying to create docker container function app, when i do docker run getting the error "Storage not defined"
遵循 Microsoft 文档 (https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-function-linux-custom-image?tabs=bash%2Cportal&pivots=programming-language-python),但针对 Azure Blob 存储触发器模板。
当我 运行 docker 运行 -p 8080:80 -it example/azurefunctionsimage:v1.0 出现以下错误时,
fail: Host.Startup[402]
fail: Host.Startup[402]
The 'voice-text' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.voice-text'. Microsoft.Azure.WebJobs.Extensions.Storage: Storage account connection string 'AzureWebJobsStorage' does not exist. Make sure that it is a defined App Setting.
Hosting environment: Production
Content root path: /
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.
info: Host.General[316]
Host lock lease acquired by instance ID '0000000000000000000000000'.
warn: Microsoft.Azure.WebJobs.Script.ChangeAnalysis.ChangeAnalysisService[0]
Breaking change analysis operation failed
System.InvalidOperationException: The BlobChangeAnalysisStateProvider requires the default storage account 'Storage', which is not defined.
at Microsoft.Azure.WebJobs.Script.ChangeAnalysis.BlobChangeAnalysisStateProvider.GetCurrentAsync(CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script.WebHost/BreakingChangeAnalysis/BlobChangeAnalysisStateProvider.cs:line 40
at Microsoft.Azure.WebJobs.Script.ChangeAnalysis.ChangeAnalysisService.TryLogBreakingChangeReportAsync(CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script.WebHost/BreakingChangeAnalysis/ChangeAnalysisService.cs:line 92
请帮忙解决这个错误..
Azure Functions 需要一个存储帐户才能在本地运行。
添加它的最佳方法是在 Azure 中创建一个存储帐户,并将连接字符串作为名为 AzureWebJobsStorage 的环境变量传递给 docker 运行 命令。
docker run -p 8080:80 -it -e AzureWebJobsStorage="{connection-string}" <docker-id>/mydockerimage:v1.0.0
遵循 Microsoft 文档 (https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-function-linux-custom-image?tabs=bash%2Cportal&pivots=programming-language-python),但针对 Azure Blob 存储触发器模板。
当我 运行 docker 运行 -p 8080:80 -it example/azurefunctionsimage:v1.0 出现以下错误时,
fail: Host.Startup[402]
fail: Host.Startup[402]
The 'voice-text' function is in error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.voice-text'. Microsoft.Azure.WebJobs.Extensions.Storage: Storage account connection string 'AzureWebJobsStorage' does not exist. Make sure that it is a defined App Setting.
Hosting environment: Production
Content root path: /
Now listening on: http://[::]:80
Application started. Press Ctrl+C to shut down.
info: Host.General[316]
Host lock lease acquired by instance ID '0000000000000000000000000'.
warn: Microsoft.Azure.WebJobs.Script.ChangeAnalysis.ChangeAnalysisService[0]
Breaking change analysis operation failed
System.InvalidOperationException: The BlobChangeAnalysisStateProvider requires the default storage account 'Storage', which is not defined.
at Microsoft.Azure.WebJobs.Script.ChangeAnalysis.BlobChangeAnalysisStateProvider.GetCurrentAsync(CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script.WebHost/BreakingChangeAnalysis/BlobChangeAnalysisStateProvider.cs:line 40
at Microsoft.Azure.WebJobs.Script.ChangeAnalysis.ChangeAnalysisService.TryLogBreakingChangeReportAsync(CancellationToken cancellationToken) in /src/azure-functions-host/src/WebJobs.Script.WebHost/BreakingChangeAnalysis/ChangeAnalysisService.cs:line 92
请帮忙解决这个错误..
Azure Functions 需要一个存储帐户才能在本地运行。
添加它的最佳方法是在 Azure 中创建一个存储帐户,并将连接字符串作为名为 AzureWebJobsStorage 的环境变量传递给 docker 运行 命令。
docker run -p 8080:80 -it -e AzureWebJobsStorage="{connection-string}" <docker-id>/mydockerimage:v1.0.0