Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure servicebus trigger queue not hitting code in local debugging

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"    
      }      
like image 322
sam Avatar asked Apr 30 '26 06:04

sam


1 Answers

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.

like image 155
Ian Bennett Avatar answered May 02 '26 00:05

Ian Bennett