Toolkit: az, gcloud and Friends
A working set of tools for someone who already has the AWS CLI in muscle memory: what to install, what each tool is for, and a phrasebook of everyday commands.
Install list
| Tool | What it's for | Notes |
|---|---|---|
Azure CLI (az) |
everything in Azure | extensions add commands on demand (az extension add -n <name>); az upgrade |
Azure PowerShell (Az module) |
the same, as PowerShell cmdlets | common in Windows-heavy teams |
| Bicep CLI | build, lint and decompile Bicep | bundled with az (az bicep install, az bicep build, az bicep decompile) |
Azure Developer CLI (azd) |
app templates: provision + deploy in one command | good for quick starts, less so for platform code |
| kubelogin | Entra ID login for AKS clusters | az aks install-cli installs kubectl and kubelogin |
| AzCopy | fast bulk copy to/from Blob and Files | also S3 → Blob copies |
| aztfexport | generate Terraform from existing Azure resources | review the output; it's a starting point |
Google Cloud CLI (gcloud) |
everything in Google Cloud | gcloud components install/update; alpha and beta command groups for newer features |
gcloud storage |
object storage commands | replaces gsutil for most uses |
bq |
BigQuery | ships with the gcloud CLI |
| gke-gcloud-auth-plugin | kubectl authentication to GKE | gcloud components install gke-gcloud-auth-plugin |
| Cloud SQL Auth Proxy | IAM-authenticated, encrypted connections to Cloud SQL | also as a sidecar in GKE |
gcloud beta resource-config bulk-export |
export existing resources as Terraform | uses Config Connector's resource definitions |
Terraform / OpenTofu with azurerm and google |
cross-cloud IaC | Terraform course |
| Cloud Shell (both) | browser shell with the CLIs preinstalled and authenticated | handy for one-offs; not for long jobs |
Phrasebook
The same everyday tasks in all three CLIs. The model prints a cheat sheet you can filter by keyword:
PHRASES = [
("who am I", "aws sts get-caller-identity", "az account show", "gcloud auth list && gcloud config list"),
("switch target", "export AWS_PROFILE=prod", "az account set -s shop-prod", "gcloud config set project shop-prod-4821"),
("list VMs", "aws ec2 describe-instances", "az vm list -o table", "gcloud compute instances list"),
("stop VM", "aws ec2 stop-instances --instance-ids i-1", "az vm deallocate -g rg -n vm1", "gcloud compute instances stop vm1 --zone=z"),
("copy to storage", "aws s3 cp f s3://b/", "az storage blob upload --auth-mode login ...", "gcloud storage cp f gs://b/"),
("list buckets", "aws s3 ls", "az storage account list -o table", "gcloud storage ls"),
("kubeconfig", "aws eks update-kubeconfig --name c", "az aks get-credentials -g rg -n c", "gcloud container clusters get-credentials c --location=r"),
("registry login", "aws ecr get-login-password | docker login ...", "az acr login -n reg", "gcloud auth configure-docker r-docker.pkg.dev"),
("read a secret", "aws secretsmanager get-secret-value --secret-id s", "az keyvault secret show --vault-name kv -n s", "gcloud secrets versions access latest --secret=s"),
("grant a role", "aws iam attach-role-policy ...", "az role assignment create ...", "gcloud projects add-iam-policy-binding ..."),
("recent API calls", "aws cloudtrail lookup-events", "az monitor activity-log list --offset 1h", "gcloud logging read 'logName:cloudaudit' --freshness=1h"),
("delete everything", "(delete each stack / account)", "az group delete -n rg --yes", "gcloud projects delete p"),
]
def cheat(keyword=""):
for task, aws, az, g in PHRASES:
if keyword in task:
print(f"# {task}")
print(f" aws: {aws}")
print(f" az: {az}")
print(f" gcloud: {g}")
cheat("VM")
cheat("secret")# list VMs
aws: aws ec2 describe-instances
az: az vm list -o table
gcloud: gcloud compute instances list
# stop VM
aws: aws ec2 stop-instances --instance-ids i-1
az: az vm deallocate -g rg -n vm1
gcloud: gcloud compute instances stop vm1 --zone=z
# read a secret
aws: aws secretsmanager get-secret-value --secret-id s
az: az keyvault secret show --vault-name kv -n s
gcloud: gcloud secrets versions access latest --secret=s
Change the arguments to cheat() (try "kube", "delete" or "" for all rows).
Shell helpers worth keeping
# Show where az and gcloud are pointing, before anything destructive
cloudctx() {
echo "azure : $(az account show --query '[name, id]' -o tsv 2>/dev/null | paste -sd' ')"
echo "gcloud: $(gcloud config get-value project 2>/dev/null) ($(gcloud config configurations list --filter=is_active=true --format='value(name)'))"
}
# Find every Azure resource with a tag, across the subscription
az resource list --tag env=dev --query "[].{name:name, type:type, rg:resourceGroup}" -o table
# Search all resources in a Google Cloud project (Cloud Asset Inventory)
gcloud asset search-all-resources --scope=projects/shop-dev-4821 \
--query="labels.env=dev" --format="table(name.basename(), assetType, location)"
# Azure Resource Graph: KQL over every resource you can see, across subscriptions
az graph query -q "Resources | where type =~ 'microsoft.compute/virtualmachines' | summarize count() by location"Azure Resource Graph (az graph query, from the resource-graph extension) and Cloud Asset Inventory (gcloud asset) are the inventory tools to learn early: they answer "what do we have, where?" across subscriptions or the whole organization, which on AWS needs AWS Config aggregators or Resource Explorer.
Docs worth bookmarking
- Microsoft Learn: the Azure Architecture Center, the Cloud Adoption Framework (landing zones) and the "Azure for AWS professionals" comparison pages.
- Google Cloud: the Architecture Center, the enterprise foundations blueprint, and the "Compare AWS and Azure services to Google Cloud" page.
- Each CLI's reference:
az <group> <command> --helpandgcloud <group> <command> --helpare current for your installed version, which matters when flags change (as with the PostgreSQL HA flag in Managed Relational Databases).
Test yourself
Which tool answers 'list every VM across all my Azure subscriptions' in one query?
- az vm list
- Azure Resource Graph (
az graph query) - AzCopy
- Bicep
What does gke-gcloud-auth-plugin do?
- Creates clusters
- Provides kubectl with Google credentials to authenticate to GKE
- Scans images
- Installs Terraform
Which Google Cloud service lets you search resources by label across a project or organization?
- Cloud Asset Inventory
- Cloud Logging
- Artifact Registry
- Cloud Build