Skip to content

Cloud CLI: Azure

Azure commands from the Cloud CLI folder.

Index
4 items

Azure: Log in and select a subscription

Safe

Interactive login, then pin the subscription for following commands.

az login && az account set --subscription "<subscription>"
What each part does
  1. az loginsign in via the browser (or device code)
  2. &&run the next command only if login succeeded
  3. az account setchange the active subscription for later az commands
  4. --subscription "<subscription>"subscription name or ID

Also known as: az login · azure subscription

Azure: Get AKS cluster credentials

Safe

Merge the AKS cluster into ~/.kube/config.

az aks get-credentials -g <resource-group> -n <cluster>
What each part does
  1. az aks get-credentialsmerge the AKS cluster into ~/.kube/config and switch to it
  2. -g <resource-group>resource group that holds the cluster
  3. -n <cluster>the cluster name

Also known as: aks kubeconfig · az aks

Azure: Stream App Service logs

Safe

Live application and web server logs from an App Service.

az webapp log tail -g <resource-group> -n <app>
What each part does
  1. az webapp log tailstream live logs from an App Service app
  2. -g <resource-group>resource group of the app
  3. -n <app>the web app name; app logging must be enabled (az webapp log config)

Also known as: webapp logs · app service logs

Azure: Read a Key Vault secret

Caution

Prints a secret's current value.

az keyvault secret show --vault-name <vault> -n <secret-name> --query value -o tsv
What each part does
  1. az keyvault secret showread the current version of a Key Vault secret
  2. --vault-name <vault>the Key Vault name
  3. -n <secret-name>the secret name
  4. --query valueJMESPath: keep only the secret value
  5. -o tsvplain text output without JSON quotes

Also known as: key vault · keyvault

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…