Azure函数运行时配置
我正在尝试使用官方的Azure函数运行时配置,azure,azure-functions,azure-functions-runtime,Azure,Azure Functions,Azure Functions Runtime,我正在尝试使用官方的microsoft/azure-functions-node8图像对azure函数进行dockerize。我找不到任何关于配置运行时的文档,每当我运行运行时,都会出现以下错误: The listener for function 'Functions.health' was unable to start. Microsoft.Azure.WebJobs.Host.Listeners.FunctionListenerException: The listener
microsoft/azure-functions-node8
图像对azure函数进行dockerize。我找不到任何关于配置运行时的文档,每当我运行运行时,都会出现以下错误:
The listener for function 'Functions.health' was unable to start.
Microsoft.Azure.WebJobs.Host.Listeners.FunctionListenerException: The listener for function 'Functions.health' was unable to start. ---> System.AggregateException: One or more errors occurred. (Microsoft Azure WebJobs SDK 'Storage' connection string is missing or empty. The Microsoft Azure Storage account connection string can be set in the following ways:
1. Set the connection string named 'AzureWebJobsStorage' in the connectionStrings section of the .config file in the following format <add name="AzureWebJobsStorage" connectionString="DefaultEndpointsProtocol=http|https;AccountName=NAME;AccountKey=KEY" />, or
2. Set the environment variable named 'AzureWebJobsStorage', or
3. Set corresponding property of JobHostConfiguration.)
.config
文件格式是否在任何地方都有文档记录?这是一个老提示,用于提醒我们默认存储连接AzureWebJobsStorage
设置不正确,这在很久以前就已改进为更易于理解。看看这个,然后
看起来像在docker图像中,不知何故忽略了此修复
要解决您的问题,只需在Dockerfile中设置AzureWebJobsStorage
ENV AzureWebJobsStorage=DefaultEndpointsProtocol=https;AccountName=xxx;AccountKey=xxx==;EndpointSuffix=core.windows.net
请注意,如果使用的名称不是azurewebjobstorage
,则需要在function.json
文件中使用名称设置连接
参数
更新
根据Connor的评论,我提到的修复添加到cli工具中,docker映像没有使用该工具,因此我们仍然可以看到此原始运行时错误。docker映像中省略该修复的原因是,新的错误消息添加到cli工具中,因此在运行时尝试执行之前会捕获该问题。docker映像没有使用CLI工具,因此您可以看到运行时抛出的原始错误。@ConnorMcMahon感谢您的解释。我将提出一个需要改进的问题。
ENV AzureWebJobsStorage=DefaultEndpointsProtocol=https;AccountName=xxx;AccountKey=xxx==;EndpointSuffix=core.windows.net