11
votes

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.

4

4 Answers

37
votes

Go to New Azure portal and get the Azure Service bus Connection string. Here I attached the image to follow up the instruction.

enter image description here

7
votes

On the portal Go to your service bus queue, -> Shared access policies -> RootManageSharedAccessKey -> On the pane that opens on the right, copy the Primary Connection string.

4
votes

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

2
votes

For those using Azure CLI this will do

az servicebus namespace authorization-rule keys list \
    -n RootManageSharedAccessKey -g <group> --namespace-name <namespace> \
    --query primaryConnectionString -o tsv