Search code examples
azureazureservicebusazure-cliazure-cli2

Retrieve Service Bus primaryConnectionString with az cli


Is it possible to get Azure Service Bus primaryConnectionString with AZ CLI?

Input parameters:

  1. Resource Group
  2. Service Bus Name

Solution

  • Years later it's now supported. In case anyone else stumbles upon this question like me, it can be done this way:

    az servicebus namespace authorization-rule keys list --resource-group myresourcegroup --namespace-name mynamespace --name RootManageSharedAccessKey --query primaryConnectionString -o tsv