Skip to main content
Advanced Search
Search Terms
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

272 total results found

Authenticate via the CLI

Azure - Cheatsheet Powershell Installation and Modules

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

Azure - Cheatsheet Info Gathering

az account list  

Get tenant id

Azure - Cheatsheet Info Gathering

az account list | jq '.[].tenantId'  

Get subscription id

Azure - Cheatsheet Info Gathering

az cli: az account list | jq '.[].id' Powershell: Get-AzSubscription Resources:Powershell docsClI docs

List tenants

Azure - Cheatsheet Info Gathering

az account tenant list  

List Resource Groups by name

Azure - Cheatsheet Info Gathering

az group list | jq -r '.[].name' Resource: https://docs.microsoft.com/en-us/cli/azure/group?view=azure-cli-latest

Set Subscription

Azure - Cheatsheet Info Gathering

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

Azure - Cheatsheet Info Gathering

az vm list Resource: https://docs.microsoft.com/en-us/cli/azure/vm?view=azure-cli-latest

General

Azure - Cheatsheet Blob Storage

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

Azure - Cheatsheet Blob Storage

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

Azure - Cheatsheet Blob Storage

az storage container list --account-name $AZURE_STORAGE_ACCOUNT --account-key "$AZURE_STORAGE_KEY"  

List storage container contents

Azure - Cheatsheet Blob Storage

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

Azure - Cheatsheet Blob Storage

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

Azure - Cheatsheet Azure Kubernetes (k8s)

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

Azure - Cheatsheet Azure Kubernetes (k8s)

az aks list Resource: https://docs.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest

Get Resource Group Name for clusters

Azure - Cheatsheet Azure Kubernetes (k8s)

AZ_RESOURCE_GROUP_NAME=$(az aks list | jq -r '.[].resourceGroup')  

Get Cluster Name

Azure - Cheatsheet Azure Kubernetes (k8s)

AZ_CLUSTER_NAME=$(az aks list | jq -r '.[].name')  

Configure kubectl

Azure - Cheatsheet Azure Kubernetes (k8s)

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...