14

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.

Maris
  • 4,608
  • 6
  • 39
  • 68

4 Answers4

44

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

Reshma Sulthan
  • 531
  • 5
  • 5
9

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.

Abhay Bhangale
  • 111
  • 1
  • 2
4

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

Brendan Green
  • 11,676
  • 5
  • 44
  • 76
  • option (1) is already not working cause it uses old azure portal credential. But old portal is blocked inside of our company network. I am able only to login only using - "Login-AzureRmAccount". But in the case when I run step (3) I get an exception - "Object reference is not set to an instance of an object". Any other workaround? – Maris May 25 '16 at 05:38
  • It's an azure credential - the same credential that's used regardless of which version of the portal that you login to. At this point, I have to ask what on earth your company is doing to block you from accessing these resources!? You're not going to be able to manage any service bus related resources, since they haven't been ported to the new portal yet. – Brendan Green May 25 '16 at 11:01
  • Security department for some unknown reason has blocked the old portal... Yeap, I agree it's weird. But another weird things comes from Microsoft, why they introduced new portal until they haven't ported all existing functionality to new portal. Also why on earth I cannot play around SBNamespaces using 'Login-AzureRmAccount' in azure power shell. – Maris May 25 '16 at 11:44
  • This only works if you are designated subscription admin or co-admin. For more up to date answer look below. – Egor Pavlikhin Nov 25 '19 at 05:30
4

For those using Azure CLI this will do

az servicebus namespace authorization-rule keys list \
    -g "<group>" \
    --namespace-name "<namespace>" \
    -n "RootManageSharedAccessKey" \
    --query "primaryConnectionString" -o tsv
Evandro Pomatti
  • 13,341
  • 16
  • 97
  • 165