使用服务总线触发器创建 Azure 函数并部署在 Azure 门户中。使用 servicebusexplorer,将队列发送到门户并正常工作。但是在azure中停止该功能后,将消息从资源管理器发送到visual studio中的本地代码进行调试。但是它没有火。
我在 local.settings.json 中给出了服务连接字符串,队列名称是正确的。从 visual studio 运行函数后,它在 azure CLI 中抛出错误。
错误:
MessageReceiver error (Action=Receive, ClientId=MessageReq.queue, Endpoint=sss-bbbb.servicebus.windows.net)xxxxx.queue, EntityPath=sss.ccccc
Microsoft.Azure.ServiceBus: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ErrorCode: TimedOut. System.Private.CoreLib: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
local.settings.json
{
"IsEncrypted": false,
"Values":
{
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureWebJobsDashboard": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"ServiceBusConnectionString": "Endpoint=//",
"RequestTimeout": "600000"
}
最佳答案
我遇到过类似的问题,公司防火墙阻止了服务总线流量。
我将 TransportType=AmqpWebSockets
附加到我的连接字符串的末尾并且它起作用了。
关于visual-studio-2017 - Azure 服务总线触发器队列未在本地调试中命中代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57921818/