Advanced Search
Search Results
272 total results found
Authenticate via the CLI
Run this command to get authenticated: az login This will result in a web browser opening, or a URL prompt. Navigating to this url will prompt you for a code, which you’ve been provided in the command line. Paste it in, click next, and select the proper acco...
List subscriptions for authenticated account
az account list
Get tenant id
az account list | jq '.[].tenantId'
Get subscription id
az cli: az account list | jq '.[].id' Powershell: Get-AzSubscription Resources:Powershell docsClI docs
List tenants
az account tenant list
List Resource Groups by name
az group list | jq -r '.[].name' Resource: https://docs.microsoft.com/en-us/cli/azure/group?view=azure-cli-latest
Set Subscription
az cli: az account set -s <name or id> Powershell: Set-AzureSubscription -Id [Subscription ID] Resources:https://powerzure.readthedocs.io/en/latest/Requirements/requirements.htmlhttps://stackoverflow.com/questions/38475104/azure-cli-how-to-change-subscript...
List all VMs
az vm list Resource: https://docs.microsoft.com/en-us/cli/azure/vm?view=azure-cli-latest
General
List all storage accounts and output in a table format: az storage account list -o table List all storage accounts and get storage account names: az storage account list -o json | jq -r '.[].name' You can assign one of the account names to an env var if yo...
Get storage keys
If you set the env var: az storage account keys list -n $AZURE_STORAGE_ACCOUNT You can assign one of the keys to an env var if you’d like: export AZURE_STORAGE_KEY='<your key from the output of the previous command>'
List storage containers
az storage container list --account-name $AZURE_STORAGE_ACCOUNT --account-key "$AZURE_STORAGE_KEY"
List storage container contents
az storage blob list --container-name <name of storage container from previous command> --account-name $AZURE_STORAGE_ACCOUNT --account-key $AZURE_STORAGE_KEY Resource: https://www.secsignal.org/en/news/how-i-hacked-a-domain-controller-in-azure-during-a-penet...
List blob names
az storage blob list --container-name <name of storage container from previous command> --account-name $AZURE_STORAGE_ACCOUNT --account-key $AZURE_STORAGE_KEY | jq '.[].name'
Get available versions of k8s in a region
REGION=westus2 # This will vary depending on the region you're using az aks get-versions --location $REGION -o table Resource: https://gist.github.com/yokawasa/fd9d9b28f7c79461f60d86c23f615677#aks-cheat-sheet
List managed k8s clusters
az aks list Resource: https://docs.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest
Get Resource Group Name for clusters
AZ_RESOURCE_GROUP_NAME=$(az aks list | jq -r '.[].resourceGroup')
Get Cluster Name
AZ_CLUSTER_NAME=$(az aks list | jq -r '.[].name')
Configure kubectl
This is pretty awesome, good job Microsoft: az aks get-credentials --resource-group $AZ_RESOURCE_GROUP_NAME --name $AZ_CLUSTER_NAME Resources:https://www.reddit.com/r/kubernetes/comments/8ohxcz/how_to_connect_kubectl_to_aks/https://docs.microsoft.com/en-us/a...