2
votes

Created Azure function with service bus trigger and deployed in azure portal. Using servicebusexplorer, sending the queue to portal and working fine. But after stopped the function in azure, sending the message from explorer to local code in visual studio for debugging. But it doesn't fire.
I have given service connection string in local.settings.json and queue name are correct. It throwing the error in azure CLI after running the function from visual studio.

ERROR:

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"    
      }      
2
you have a real endpoint in your config right? its not actually "ServiceBusConnectionString": "Endpoint=//",Twisted

2 Answers

6
votes

I have had a similar issue with s corporate firewalls blocking the Service Bus traffic. I appended TransportType=AmqpWebSockets to the end of my connection string and it worked.

0
votes

I’ve seen this happen before once when local firewall policies were blocking the AMQP connections that functions are using. A console app would likely fail as well using the service bus .NET Core SDKs if that was the case. That said could you try on a different network? Error reads that it’s a network resolution issue.