Skip to content

Azure ​

Clanker supports querying Azure infrastructure using the az CLI. Queries are routed to Azure by an explicit flag or by automatic keyword detection.


Authentication ​

Azure authentication uses the az CLI login flow.

Setting up authentication ​

bash
# Interactive login
az login

# Set default subscription
az account set --subscription your-subscription-id

# Verify
az account show

Configuration ​

Add your Azure subscription ID to ~/.clanker.yaml:

yaml
infra:
  azure:
    subscription_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Subscription ID resolution order ​

  1. --azure-subscription CLI flag
  2. infra.azure.subscription_id in the config file
  3. AZURE_SUBSCRIPTION_ID environment variable
  4. AZ_SUBSCRIPTION_ID environment variable

Querying Azure ​

Explicit flag ​

bash
clanker ask --azure "What virtual machines are running?"

Automatic routing ​

If your question mentions Azure-specific services, Clanker routes to Azure automatically:

bash
clanker ask "List all Azure Container Apps"

Supported Services ​

Clanker queries Azure services through the az CLI. Commonly queried services include:

  • Virtual Machines
  • Azure Kubernetes Service (AKS)
  • Container Apps
  • App Service, Function Apps, Static Web Apps
  • Azure SQL, PostgreSQL Flexible Server, MySQL Flexible Server, Cosmos DB, Redis
  • Storage accounts
  • Virtual Networks
  • Load Balancers, Front Door/CDN, Application Gateway, WAF policies
  • Key Vault
  • Container Registries, Container Instances
  • Azure AI Services, Azure OpenAI resources, Azure AI Search, Azure Machine Learning workspaces
  • Service Bus, Event Hubs, Event Grid, Logic Apps, Data Factory
  • Log Analytics and Application Insights
  • Private endpoints, NSGs, route tables, DNS zones, private DNS zones, public IPs

Direct inventory examples:

bash
clanker azure list resource-graph --subscription <subscription-id>
clanker azure list ai-search
clanker azure list private-endpoints
clanker azure list ml-workspaces

Maker Pipeline ​

The maker feature supports Azure infrastructure provisioning:

bash
# Generate a plan
clanker ask --maker --azure "Create a resource group called my-rg in eastus"

# Apply the plan
clanker ask --apply --plan-file plan.json --azure-subscription your-sub-id

Azure maker plans require the subscription ID during both generation and execution.


Backend Credentials ​

For team environments, Azure service principal credentials can be stored and retrieved through the Clanker backend:

bash
clanker credentials store azure
clanker ask --api-key ck_live_abc123 --azure "What VMs are running?"

When backend credentials include a service principal (tenant ID, client ID, client secret), Clanker performs an az login --service-principal before executing queries.