运行计时器在 MAC 上本地触发 azure 函数(在 docker 内)

meh*_*ran 2 macos timer node.js azure-functions

我试图在 MAC 上(在 docker 内部)本地运行计时器触发的 nodejs azure 函数,但出现以下错误:

The listener for function 'Functions.MyTimerFunction' was unable to start. Microsoft.WindowsAzure.Storage: Connection refused. System.Net.Http: Connection refused. System.Private.CoreLib: Connection refused.
Run Code Online (Sandbox Code Playgroud)

当我尝试使用 HTTP post 触发该函数时,出现以下错误:

System.Private.CoreLib: Exception while executing function: Functions.DomainVerifier. Microsoft.Azure.WebJobs.Host: Exception binding parameter 'myTimer'. Microsoft.WindowsAzure.Storage: Connection refused. System.Net.Http: Connection refused. System.Private.CoreLib: Connection refused.
Run Code Online (Sandbox Code Playgroud)

这是我的local.settings.json文件中:

"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureWebJobsSecretStorageType": "files",
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏。

Geo*_*hen 6

我可以重现这个错误,我用本地 Windows 电脑进行测试。UseDevelopmentStorage=true当您使用并且 Storage Emulator未启动时,您会收到此错误。

因此,请设置您的存储连接或在本地环境中AzureWebJobsStorage启动。Storage Emulator启动存储模拟器后它将开始工作。

在此输入图像描述

  • 是的,目前没有适用于 Mac 的存储模拟器,但有开源替代方案:[Azurite](https://github.com/arafato/azurite)。 (2认同)