A fast, lightweight Azure CLI implementation in Go with 100+ commands for managing Azure resources.
This project provides a performant alternative to the official Azure CLI, written in Go using the Azure SDK. It offers comprehensive resource management capabilities across compute, network, storage, database, and identity services.
az login- Authenticate with Azure using device code flowaz logout- Sign out from Azureaz account- Manage subscriptions and authentication tokens
az vm- Manage virtual machines (list, show, start, stop, delete, list-skus)az ssh- SSH into VMs and Arc servers with Entra ID certificates (vm, config, cert, arc); built in, no extension needed
az network vnet- Manage virtual networks (CRUD operations)az network subnet- Manage subnets (CRUD operations)az network nsg- Manage network security groups (CRUD operations)az network nsg rule- Manage security rules (CRUD operations)az network nat- Manage NAT gateways (CRUD operations)az network lb- Manage load balancers (CRUD operations)az network vnet-peering- Manage VNet peering (CRUD operations)az network private-endpoint- Manage private endpoints (CRUD operations)az network vnet-gateway- Manage VPN gateways (CRUD operations)az network bastion- SSH and tunnel through Azure Bastion
az storage account- Manage storage accounts (CRUD operations)az storage container- Manage blob containers (CRUD operations)
az postgres flexible-server- Manage PostgreSQL flexible servers (CRUD operations)
az identity- Manage managed identities (CRUD operations)az role- Manage role definitions and assignmentsaz group- Manage resource groups (CRUD operations)az pim- List and activate eligible PIM role assignments and Entra group memberships
az keyvault- Manage Key Vaults (list, show)az keyvault secret- Manage secrets (list, show, set, delete)
az aks- Manage Azure Kubernetes Service clustersaz aks nodepool- Manage AKS node poolsaz aks addon- Manage AKS add-ons
az quota- Manage and request service quotas
brew tap dobbo-ca/azure-go-cli
brew install azure-go-cliDownload the latest release for your platform from the releases page.
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
$assets = (Invoke-RestMethod 'https://api.github.com/repos/dobbo-ca/azure-go-cli/releases/latest').assets
$asset = $assets | Where-Object { $_.name -like 'az-go-*-windows-amd64.msi' } | Select-Object -First 1
if (-not $asset) { throw "No Windows MSI found on the latest release" }
$sha = $assets | Where-Object { $_.name -eq "$($asset.name).sha256" } | Select-Object -First 1
if (-not $sha) { throw "No .sha256 for $($asset.name)" }
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $asset.name
Invoke-WebRequest -Uri $sha.browser_download_url -OutFile $sha.name
if ((Get-FileHash $asset.name -Algorithm SHA256).Hash -ine (Get-Content $sha.name).Trim()) { throw "checksum mismatch" }
$p = Start-Process msiexec.exe -ArgumentList '/i', "`"$PWD\$($asset.name)`"", '/qn', '/norestart' -Wait -Verb RunAs -PassThru
if ($p.ExitCode -ne 0) { throw "msiexec failed with exit code $($p.ExitCode)" }Open a new terminal, then check with where.exe az and az version. The MSI is not code-signed, so expect a UAC prompt from an unknown publisher.
See docs/windows-install.md for silent/logged install flags, upgrade/uninstall, and the Microsoft Azure CLI name-conflict note.
git clone https://github.com/dobbo-ca/azure-go-cli.git
cd azure-go-cli
make buildThe binary will be created at bin/az/az.
# Login to Azure
az login
# Set default subscription
az account set --subscription "My Subscription"
# Show current account
az account showSet the AZ_SESSION environment variable to scope the CLI's profile and
MSAL token cache to a session-specific file, allowing multiple
authenticated sessions to coexist without overwriting each other:
export AZ_SESSION=customer-a
az login # writes ~/.azure/azureProfile-customer-a.json
# and ~/.azure/msal_token_cache-customer-a.json
# In another terminal, a separate session
export AZ_SESSION=customer-b
az login # uses its own profile and token cacheWhen unset, the standard ~/.azure/azureProfile.json and
~/.azure/msal_token_cache.json are used.
az aks bastion pins the active AZ_SESSION into the generated
kubeconfig's az aks get-token exec env block, so kubectl subprocesses
launched from any shell continue to use the right session profile/cache
without needing the env var re-exported.
# List all VMs
az vm list
# Show specific VM
az vm show --name my-vm --resource-group my-rg
# Start/stop VM
az vm start --name my-vm --resource-group my-rg
az vm stop --name my-vm --resource-group my-rg
# List available VM SKUs
az vm list-skus --location eastus# SSH with a short-lived Entra ID certificate
az ssh vm --ip 10.0.0.4
az ssh vm -g my-rg -n my-vm
# Write a config for plain ssh, MobaXterm, rsync, git
az ssh config --ip 10.0.0.4 --file ./sshconfig
ssh -F ./sshconfig 10.0.0.4# Create NSG
az network nsg create --name my-nsg --resource-group my-rg --location eastus
# Create security rule
az network nsg rule create --name allow-ssh \
--nsg-name my-nsg --resource-group my-rg \
--priority 1000 --direction Inbound --access Allow \
--protocol TCP --source-address-prefix "*" \
--source-port-range "*" --destination-address-prefix "*" \
--destination-port-range 22
# List rules
az network nsg rule list --nsg-name my-nsg --resource-group my-rg# Create storage account
az storage account create --name mystorageacct \
--resource-group my-rg --location eastus
# Create blob container
az storage container create --name my-container \
--account-name mystorageacct --resource-group my-rg# Merge cluster credentials into ~/.kube/config
az aks get-credentials --name my-cluster --resource-group my-rg
# Open a tunnel to a private AKS cluster through Azure Bastion
az aks bastion --name my-cluster --resource-group my-rg \
--bastion /subscriptions/.../bastionHosts/my-bastionWhen several clusters share the same name (e.g., customer deployments
called appcluster-prod-usw2-k8s-20251209) the context name is ambiguous
for internal staff. Two flags rewrite every identifier in the kubeconfig
(current-context, clusters[].name, contexts[].name,
contexts[].context.cluster, contexts[].context.user, users[].name)
on both az aks get-credentials and az aks bastion:
# Literal rename — replaces the cluster name throughout the kubeconfig
az aks get-credentials -n appcluster-prod-usw2-k8s-20251209 -g my-rg \
--context acme-prod
# Regex rename — pattern is matched against the cluster name; the
# replacement (with $1, $2 capture group support) is propagated to
# every identifier field.
az aks get-credentials -n appcluster-prod-usw2-k8s-20251209 -g my-rg \
--context-regex '^appcluster-(.+)$' --context-replacement 'acme-$1'
# → context becomes acme-prod-usw2-k8s-20251209
az aks bastion -n appcluster-prod-usw2-k8s-20251209 -g my-rg \
--bastion /subscriptions/.../bastionHosts/my-bastion \
--context-regex '^appcluster' --context-replacement 'acme'--context-regex and --context-replacement must be supplied together
and cannot be combined with --context.
az pim lists and activates eligible PIM assignments — Azure resource roles and Entra ID group memberships — and inherits AZ_SESSION isolation so multiple customer sessions stay separated.
# List eligible and currently-active assignments
az pim list
# Activate a resource role
az pim activate resource --role Contributor --scope "Acme Corp/Acme Production" \
--ticket Jira:TEC-1234 --justification "Investigating INC-9999" --duration 60
# Activate an Entra group membership
az pim activate group --name customer-acme-admins \
--justification "Customer hand-off" --duration 120See docs/pim.md for the full guide: the four-form --scope resolver, --set-subscription behavior, validation pre-flight, AZ_SESSION integration for multi-customer workflows, the vendored upstream attribution, and current limitations.
# List secrets
az keyvault secret list --vault-name my-vault
# Show secret (without value)
az keyvault secret show --vault-name my-vault --name my-secret
# Show secret with value
az keyvault secret show --vault-name my-vault --name my-secret --show-value
# Set secret
az keyvault secret set --vault-name my-vault --name my-secret --value "secret-value"All commands support multiple output formats:
# JSON (default)
az vm list
# Table format
az vm list --output table
# YAML format
az vm list --output yaml
# TSV for scripting
az vm list --output tsvFilter output using JMESPath:
# Get only VM names
az vm list --query "[].name"
# Filter by location
az vm list --query "[?location=='eastus']"For detailed command documentation, see:
- Full command tree:
docs/command-tree.md - Implementation status: Run
./scripts/audit-commands.sh
make build # Build for current platform
make all # Build for all platforms
make test # Run tests
make clean # Clean build artifactsazure-go-cli/
├── cmd/az/ # Main entry point
├── internal/ # Internal packages
│ ├── account/ # Account management
│ ├── aks/ # AKS commands
│ ├── auth/ # Authentication
│ ├── group/ # Resource groups
│ ├── identity/ # Managed identities
│ ├── keyvault/ # Key Vault
│ ├── network/ # Network resources
│ ├── postgres/ # PostgreSQL
│ ├── storage/ # Storage
│ └── vm/ # Virtual machines
├── pkg/ # Public packages
│ ├── azure/ # Azure credential helpers
│ └── config/ # Configuration management
└── docs/ # Documentation
This project uses:
- Conventional Commits for commit messages
- Semantic Versioning for releases
- Automated releases via GitHub Actions with Uplift
Commit prefixes:
feat:- New feature (minor version bump)fix:- Bug fix (patch version bump)feat!:orBREAKING CHANGE:- Breaking change (major version bump)
- Performance: Written in Go, faster startup and execution
- Size: Smaller binary (~50MB vs 1GB+ for Python-based CLI)
- Subset of commands: Focuses on most commonly used resource management operations
- Compatible: Uses same Azure SDK and authentication as official CLI
- Go 1.21 or later (for building from source)
- Azure subscription
MIT License - see LICENSE file for details
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
See CLAUDE.md for development guidelines.