Not able to connect to Service bus topic

Ravinder KUMAR 0 Reputation points
2025-03-06T08:01:43.9833333+00:00

Hello,

I am not able to connect to service bus topic from logic app standard in Visual studio code. I am using connection string to connect it.

But through console application I am able to connect.

Getting ConnectionRefused error.
User's image

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,388 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Shireesha Eeraboina 2,065 Reputation points Microsoft External Staff
    2025-03-07T02:52:07.28+00:00

    Hi Ravinder KUMAR,

    It sounds like you're encountering a "ConnectionRefused" error when trying to connect to the Service Bus topic from your Logic App Standard in Visual Studio Code. Here are a few things to check:

    • Check the Connection String: Make sure the connection string you’re using is correct and matches the one that works in your console application.
    • Review Firewall Settings: Ensure that your firewall and port settings allow connections on the necessary ports (5671 and 5672).
    • Examine Network Configuration: Confirm that your network isn’t blocking specific IP addresses or ports. You might also want to try using the Web Socket transport option, which connects through port 443.

    If possible, test the connection in a different environment to rule out environment-specific issues.

    For your reference, please review the following documentations for further clarification:

    I hope this answers your query! Let me know if you require any additional help or clarification.


  2. bacon44 0 Reputation points
    2025-03-11T14:49:58.4033333+00:00

    Enhance security by connecting to Azure Service Bus Topics without a connection string. Use Azure AD authentication with Managed Identities or service principals for a safer, role-based access approach. Learn more about secure integration today ; also use this settings

    var clientSecretCredential = new ClientSecretCredential(

    "your-tenant-id",
    
    "your-client-id",
    
    "your-client-secret"
    

    );

    var client = new ServiceBusClient("your-servicebus-namespace.servicebus.windows.net",

    clientSecretCredential);
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.