使用服务总线触发器创建 Azure 函数并部署在 azure 门户中。使用 servicebusexplorer,将队列发送到门户并正常工作。但是在 azure 中停止该功能后,将消息从资源管理器发送到 Visual Studio 中的本地代码进行调试。但它不火。
我在 local.settings.json 中给出了服务连接字符串,并且队列名称是正确的。从 Visual Studio 运行该功能后,它会在 azure CLI 中引发错误。
错误:
MessageReceiver 错误(Action=Receive,ClientId=MessageReq.queue,Endpoint=sss-bbbb.servicebus.windows.net)xxxxx.queue,EntityPath=sss.ccccc
Microsoft.Azure.ServiceBus:连接尝试失败,因为连接方没有一段时间后正确响应,或由于连接的主机未能响应而建立连接失败 ErrorCode: TimedOut。System.Private.CoreLib:连接尝试失败,因为连接方在一段时间后没有正确响应,或者连接失败,因为连接的主机没有响应。
local.settings.json
{
"IsEncrypted": false,
"Values":
{
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"AzureWebJobsDashboard": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet",
"ServiceBusConnectionString": "Endpoint=//",
"RequestTimeout": "600000"
}