Account Level
# whoami?
az account show
# what are my subs?
az account list
# Change Subscription
az account set --s <uuid>
# list azure regions for US
az account list-locations -o table | grep "(US)"
# on Windows Powershell you can use 'findstr' instead of 'grep'
# set default region
az configure --defaults location=<region>
# update CLI configuration settings
az configure
Resource Groups
# create a resource group
az group create -n <group name>
# delete a resource group
az group delete -n <group name>
# list resource groups
az group list
# set default resource group
az configure --defaults group=<my-group-name>
Azure Containers
# Enable admin rights for this Azure CLI session
az acr update -n <registery name> --admin-enabled true
# show username/password for ACR
az acr credential show --name <registry name>.azurecr.io
# list all container registries
az acr list
# list images in registry
az acr repository list --name <registry name>
# list versions of an image
az acr repository show-tags --name <registry name> --repository streamlit
# Authenticate to the container registry
docker login <registry name>.azurecr.io
# Respond to username/password prompt with values obtained above
# Tag the image for deployment
docker tag <local tag> <registry name>.azurecr.io/<acr tag>:v1
# Deploy the image
docker push <registry name>.azurecr.io/<image name>:v1
Web Apps
# create an app service plan
az appservice plan create -g <group name> -l eastus -n <plan name> --is-linux --sku B1
# create a web app with a Docker container
az webapp create -n <web app name> -p <web app plan> -g <resource group>
-i <registry name>.azurecr.io/<remote tag>:v1
-s <registry username>
-w <registry password>
Azure AI Search
#create a new Azure Search Service
az search service create --name <service name> \
--resource-group <group name> \
--sku Free --partition-count 1 \
--replica-count 1
# Fetch the admin key for a search service
az search admin-key show -g <resource group name> \
--service-name <service name>