Authentication
Clanker CLI uses theaz CLI for all Azure operations. You must be authenticated with Azure CLI before using Clanker.
Login to Azure
Subscription configuration
Configure your Azure subscription ID in one of the following ways:.clanker.yaml
Clanker resolves the subscription ID in this order:
- Configuration file (
infra.azure.subscription_id) AZURE_SUBSCRIPTION_IDenvironment variableAZ_SUBSCRIPTION_IDenvironment variable
Service principal authentication
When using backend-provided credentials, you can authenticate using a service principal:internal/azure/client.go:51:
Querying infrastructure
Natural language queries
Ask questions about your Azure infrastructure using natural language:Context gathering
Clanker automatically gathers relevant Azure context based on your query:Supported resource types
Clanker can query these Azure resources:Compute
Compute
- Virtual Machines (VMs)
- AKS (Azure Kubernetes Service) clusters
- App Services (Web Apps)
- Function Apps
Storage & Data
Storage & Data
- Storage Accounts
- Cosmos DB accounts
- Key Vaults
Networking
Networking
- Virtual Networks (VNets)
- Network Security Groups (NSGs)
- Public IP addresses
- Load Balancers
Management
Management
- Resource Groups
- Azure Account information
- All ARM resources
Direct commands
Use theclanker azure list command to query resources directly:
Available list commands
Account & Groups
account- Current account contextgroups/rg- Resource groupsresources- All ARM resources (top 200)
Compute
vms- Virtual machinesaks- AKS clusters
App Services
webapps- App Servicesfunctionapps- Function Apps
Storage & Security
storage- Storage accountskeyvaults- Key Vaultscosmosdb- Cosmos DB
Networking
vnets- Virtual networksnsgs- Network security groupspublic-ips- Public IPsload-balancers/lbs- Load balancers
Command options
Error handling
Clanker provides intelligent error hints for Azure operations:Retry mechanism
Clanker automatically retries failedaz commands with exponential backoff for:
- Rate limiting (429 errors)
- Timeout errors
- Too many requests
- Temporarily unavailable services
Implementation details
Client initialization
Frominternal/azure/client.go:33:
Command execution
All Azure operations use theexecAz method which:
- Verifies
azCLI is installed - Appends the subscription ID and
--only-show-errorsflag - Implements retry logic for transient failures
- Provides contextual error hints
internal/azure/client.go:90:
Context gathering
When you ask questions, Clanker gathers context from relevant Azure resources. Default sections include:- Azure Account details
- Resource Groups
internal/azure/client.go:167:
Best practices
Set default subscription
Configure your subscription ID in
.clanker.yaml to avoid specifying it on every command.Use RBAC properly
Ensure your account or service principal has Reader permissions on resources you want to query.
Specific queries
Ask about specific resources to get faster results instead of broad queries.
Service principals for automation
Use service principals with minimal required permissions for automated workflows.
Examples
List virtual machines
Query App Services
Check AKS clusters
List storage accounts
View current account
Azure integration requires the
az CLI to be installed and authenticated. Run az login before using Clanker with Azure.