My Digital Garden

azure-cli

Azure CLI

A multi-platform CLI tool to manage Azure resources

See Also

Useful commands

Login : az login

Subscriptions

Show all subscriptions : az account list

Change the active subscription using the subscription name : az account set --subscription "<subscription name>"

Change the active subscription using the subscription ID : az account set --subscription "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Change the active subscription using a variable : subscriptionId="$(az account list --query "[?isDefault].id" -o tsv)"

az account set --subscription $subscriptionId

Service Bus Queries

Namespaces : az servicebus namespace list --resource-group <rg name>

Authorization Rules : az servicebus namespace authorization-rule list --resource-group <rg name> --name <namespace name>

Network Rules : az servicebus namespace network-rule list --resource-group <rg name> --name <namespace name>

Queues : az servicebus queue list --resource-group <rg name> --name <namespace name>

Queue Authorization Rule : az servicebus queue authorization-rule list --resource-group <rg name> --namespace-name <namespace name> --queue-name <queue name>

Topics : az servicebus topic list --resource-group <rg name> --name <namespace name>

Subscriptions : az servicebus topic subscription list --resource-group <rg name> --namespace-name <namespace name> --topic-name <topic name>

Subscription Rules : az servicebus topic subscription rule list --resource-group <rg name> --namespace-name <namespace name> --topic-name <topic name> --subscription-name <subscription name>