如何解决将blobTrigger与Azurite结合使用会使功能主机崩溃
我遇到了Azure Blob触发的函数使函数主机崩溃的问题。存储连接字符串或我如何使用Azurite似乎是一个问题。我正在使用的其他计时器或HTTP触发函数在“ UseDevelopmentStorage = true”设置和Azurite blob服务运行的情况下工作正常。
对于使用Azurite存储模拟器使Blob触发功能在我的开发环境中工作可能引起的问题,我感到很困惑。
有人建议我想念什么或在哪里找什么?
发生未处理的异常。主机正在关闭。 Microsoft.WindowsAzure.Storage:由于目标计算机主动拒绝连接,因此无法建立连接。 System.Net.Http:无法建立连接,因为目标计算机主动拒绝了该连接。 System.Private.CoreLib:由于目标计算机主动拒绝连接,因此无法建立连接。
{
"scriptFile": "__init__.py","bindings": [
{
"name": "myblob","type": "blobTrigger","direction": "in","path": "outcontainer/{name}","connection": "AzureWebJobsstorage"
}
]
}
{
"IsEncrypted": false,"Values": {
"AzureWebJobsstorage": "UseDevelopmentStorage=true","FUNCTIONS_WORKER_RUNTIME": "python"
}
}
这是启用了--verbose开关的控制台输出:
[9/23/2020 6:28:36 PM] Job host started
Functions:
BlobTrigger1: blobTrigger
Hosting environment: Production
Content root path: C:\sources\AzureBlobTriggerTest
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.
[9/23/2020 6:28:37 PM] LanguageWorkerConsoleLog INFO: Starting Azure Functions Python Worker.
[9/23/2020 6:28:37 PM] LanguageWorkerConsoleLog INFO: Worker ID: d4160c17-a9f0-461d-af04-18623c45a51b,Request ID: fdf8841e-8564-4f4e-a983-91553451cd9d,Host Address: 127.0.0.1:51168
[9/23/2020 6:28:37 PM] LanguageWorkerConsoleLog INFO: Successfully opened gRPC channel to 127.0.0.1:51168
[9/23/2020 6:28:37 PM] LanguageWorkerConsoleLog INFO: Detaching console logging.
[9/23/2020 6:28:37 PM] Switched to gRPC logging.
[9/23/2020 6:28:37 PM] Received WorkerInitRequest,request ID fdf8841e-8564-4f4e-a983-91553451cd9d
[9/23/2020 6:28:37 PM] Worker process started and initialized.
[9/23/2020 6:28:37 PM] Received FunctionLoadRequest,request ID: fdf8841e-8564-4f4e-a983-91553451cd9d,function ID: dc522140-aa0a-453b-8767-4aedf88435e4
[9/23/2020 6:28:37 PM] Successfully processed FunctionLoadRequest,function ID: dc522140-aa0a-453b-8767-4aedf88435e4
[9/23/2020 6:28:41 PM] Host lock lease acquired by instance ID '0000000000000000000000002B956994'.
[9/23/2020 6:29:09 PM] An unhandled exception has occurred. Host is shutting down.
[9/23/2020 6:29:09 PM] Microsoft.WindowsAzure.Storage: No connection Could be made because the target machine actively refused it. System.Net.Http: No connection Could be made because the target machine actively refused it. System.Private.CoreLib: No connection Could be made because the target machine actively refused it.
[9/23/2020 6:29:09 PM] Stopping host...
[9/23/2020 6:29:09 PM] Stopping JobHost
[9/23/2020 6:29:09 PM] Stopping the listener 'Microsoft.Azure.WebJobs.Host.Listeners.CompositeListener' for function 'BlobTrigger1'
[9/23/2020 6:29:09 PM] Stopped the listener 'Microsoft.Azure.WebJobs.Host.Listeners.CompositeListener' for function 'BlobTrigger1'
[9/23/2020 6:29:09 PM] Job host stopped
[9/23/2020 6:29:09 PM] Host shutdown completed.
解决方法
看起来我发现自己做错了。 The documentation says,“ Azure Blob存储触发器需要一个通用存储帐户。”
我只是启动Azurite Blob服务。从整个过程开始就可以正常工作。
,要在本地运行Node blobTrigger,您需要:
-
确保您正在运行节点8或10。我正在运行10.14.1
-
更改local.settings.json:
“ AzureWebJobsStorage”:“ UseDevelopmentStorage = true”
- 使用所有服务运行azurite。不仅是BlobStorage。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。