Azure CLI

log into/out of tenant

az login
az logout

see & select accounts

#ver subscripcion seleccionada
az account show 

# ver todas subscripciones disponibles
az account list 

# seleccionar suscripcion
az account set --subscription {id} 

see & manage resource-groups

az group list
az group delete --name {name} 

AKS - connect to cluster through Azure CLI

# once we're logged-in with az login into the right account
az aks get-credentials --resource-group {some-resource-group} --name {aks_name} --overwrite-existing

# now we can execute kubectl commands
kubectl get deployments --all-namespaces=true

Azure Backup Vault atascada

Se me ha quedado un backup atascado que no me dejaba borrarlo por la web. Con CLI hay que desregistrarlo y luego ya se puede borrar

# we should be able to see the resource
az backup container list -g learn-with-ai -v vault-xx00xxxx --backup-management-type AzureStorage

# unregister
az backup container unregister -g learn-with-ai -v vault-xx00xxxx --backup-management-type AzureStorage