Search code examples
azureazureservicebusservicebusazure-servicebus-queues

How to get connection string to existing servicebus without old azure portal


Due to restrictions in the company I cannot use old azure portal. But I have a requirement to use ServiceBus in our project. I was able to create servicebus ns using resource.azure.com, but I cannot find the way to get the connection string to that servicebus namespace. I was trying to play around azure power shell, but it also requires access to old azure portal... Thanks in advance.


Solution

  • You can do this via powershell with the Azure Powershell Cmdlets.

    You can find the installer for them via How to install and configure Azure PowerShell - see the link under Installing Azure PowerShell from WebPI.

    Once installed:

    1. Add the account first

      Add-AzureAccount

      Enter your credentials to connect to your Azure account

    2. Select the specific subscription that you want to work with

      Select-AzureSubscription -SubscriptionName "Your_Sub_Name"

    3. List your Service Bus namespaces

      Get-AzureSBNamespace

      All your namespaces, along with the connection string (for RootManageSharedAccessKey) will be listed.

    4. (Optional) If you have specific shared access key names that you've created, you can get them like this:

      Get-AzureSBAuthorizationRule -Namespace your_namespace

      The namespace will be the name listed in the output from step 3