Skip to main content

Azure Cloud

Connect your Azure subscriptions so the Autoheal agents can investigate incidents across your Azure infrastructure.

You connect one identity and grant it a role — we recommend Reader, for read-only access — on the subscriptions you want the agent to read. One identity covers as many subscriptions as you grant it access to, so there's no separate integration per subscription.

What the agent can do

CapabilityExamples
Resources & groupsaz group list, az resource list
Computevirtual machines and scale sets (az vm list, az vmss list)
AKSclusters and node pools (az aks list, az aks show)
Storage & networkingaz storage account list, az network …
Azure Monitormetrics and the Activity Log (az monitor metrics list, az monitor activity-log list)
Log AnalyticsKQL queries (az monitor log-analytics query)
Resource Graphcross-resource discovery across subscriptions (az graph query)

Set up

How you connect depends on where Autoheal runs. Pick your deployment:

Connect with Microsoft Entra Workload Identity Federation: create an identity in your Microsoft Entra tenant, configure it to trust Autoheal's OIDC issuer, and assign it the Reader role on the subscriptions you want the agent to read.

Prerequisites

  • One or more Azure subscriptions in a single Microsoft Entra tenant, and permission to create a user-assigned managed identity (or an Entra app registration) and assign it a role.
  • The issuer, subject, and audience values for your tenant, provided by Autoheal (in the Federated credential reference below).
  • Two values to enter in Autoheal: your Directory (Tenant) ID and the identity's Client ID. There's no subscription ID — the identity covers every subscription you grant it Reader on.
1
Create a user-assigned managed identity
az identity create -g <resource-group> -n autoheal-readonly
# note the clientId, principalId, and tenantId from the output
2
Add a federated credential that trusts Autoheal

Use the issuer / subject / audience from the Federated credential reference below:

az identity federated-credential create \
--name autoheal-federation \
--identity-name autoheal-readonly \
--resource-group <resource-group> \
--issuer "<AUTOHEAL_ISSUER>" \
--subject "<AUTOHEAL_SUBJECT>" \
--audiences "<AUTOHEAL_AUDIENCE>"
3
Assign the Reader role

Grant Reader on each subscription you want the agent to read — repeat this per subscription:

az role assignment create \
--assignee-object-id <principalId> --assignee-principal-type ServicePrincipal \
--role Reader --scope /subscriptions/<subscription-id>
# optional, for metrics & logs: --role "Monitoring Reader" / "Log Analytics Reader"

To cover many subscriptions at once, assign Reader once at a management group — it applies to every subscription beneath it (this needs elevated rights on that management group):

az role assignment create \
--assignee-object-id <principalId> --assignee-principal-type ServicePrincipal \
--role Reader --scope /providers/Microsoft.Management/managementGroups/<management-group-id>

Reader gives the agent read-only access. Assign a broader role only if you want the agent to make changes.

4
Add the integration in Autoheal

Go to Integrations → Azure Cloud → Workload Identity Federation, enter your Directory (Tenant) ID and the identity's Client ID, then Test Connection → Save. Test Connection lists the subscriptions the identity can read — confirm the ones you expect appear.

tip

Prefer an Entra app registration if your security team needs Conditional Access on the workload identity. Add the federated credential under App registrations → Certificates & secrets → Federated credentials, assign Reader to its service principal, and use the app's Application (Client) ID.

Federated credential reference

Set the federated credential to these values:

  • Issuerhttps://app.autoheal.ai
  • Subjectcoming soon on the Autoheal integration page (the per-tenant value Azure matches on sub)
  • Audience<your-tenant-slug>-oidc-service — your Autoheal organization slug followed by -oidc-service
info

Azure validates the assertion's iss / sub / aud against these values, so they must match exactly. Azure accepts a custom audience — it need not be api://AzureADTokenExchange.

Network requirements

  • Microsoft Entra → Autoheal's OIDC issuer (/.well-known/openid-configuration + JWKS) — so Entra can validate the federated assertion.
  • Agent sandbox → login.microsoftonline.com, management.azure.com — for az login and read-only az commands.

Federation needs Microsoft Entra to reach Autoheal's issuer over the public internet. For a self-hosted Azure VM (including air-gapped), use the Self-hosted (BYOC) tab instead — it talks only to the VM's local metadata service.

Multiple subscriptions

One identity covers every subscription you grant it Reader on, so a single Azure Cloud integration spans all of them — there's no per-subscription integration.

  • Grant access per subscription (repeat the Reader assignment for each), or once at a management group so every subscription beneath it is covered automatically.
  • The agent has no default subscription. It targets one explicitly per query: it reads the subscription from the alert's resource when present, otherwise from the subscription map you can label during setup, and uses Resource Graph (az graph query) to search across all of them when the subscription is unknown.
  • Scope it down by removing the Reader role on any subscription you don't want the agent to touch — what it can read is exactly what the identity can read.

Limitations

  • Single Entra tenant. One integration covers subscriptions in one Microsoft Entra tenant. Subscriptions in a different tenant need a separate identity and a separate integration.
  • Control-plane reads by default. Data-plane reads (blob contents, Key Vault secret values) need separate, opt-in data roles.
  • One identity for everything. Use the same identity for Azure Cloud and the Azure DevOps integration — grant it Reader on your subscriptions and add it to each Azure DevOps organization with read access. One identity, one Client ID, used everywhere: the agent's sandbox shares one az session, so two different identities would conflict.
info

This is the Azure Cloud integration (Azure Resource Manager, management.azure.com). It is separate from Azure DevOps (dev.azure.com — repos, pipelines, wiki). Both use the az CLI but are distinct integrations.

Example questions

Once connected, you can ask the agent:

List the resource groups and the VMs running in the prod resource group
Show the status and node pools of our AKS clusters
What's the CPU usage of the <service-name> VM over the last hour?
Query the Activity Log for failed deployments in the last 24 hours

Troubleshooting

Managed Identity: Test Connection fails / 'Please run az login'

Confirm the managed identity is attached to the Autoheal VM and that the sandbox can reach 169.254.169.254 (see the metadata-service check above). For a user-assigned identity, confirm AZURE_BYOC_MANAGED_IDENTITY_CLIENT_ID in .env is a concrete GUID (not a $(…) command) and that you restarted Autoheal.

WIF: Test Connection fails with AADSTS70021

The federated credential's issuer / subject / audience don't match Autoheal's, or it was just created. Re-check them against the Federated credential reference in the Autoheal Cloud (SaaS) tab and retry shortly — propagation can take a few minutes.

Test Connection succeeds but shows no subscriptions

The identity authenticated but has Reader on nothing yet. Add the role assignment — on a subscription, or at a management group above it — and retry (assignments take a minute to propagate).

Test Connection shows fewer subscriptions than expected

The identity has Reader on only some of them. Grant Reader on each missing subscription (or once at a management group above them) and retry — new assignments take a minute to propagate.

403 / access denied

The identity lacks the Reader role on that subscription. Add the role assignment — on the subscription, or at a management group above it — and retry (assignments take a minute to propagate).

Can list resources but not metrics or logs

Add Monitoring Reader (for az monitor metrics list) and Log Analytics Reader (for az monitor log-analytics query).

How to revoke Autoheal's access

Delete the federated credential (SaaS) or detach the managed identity (BYOC), or remove the Reader role assignment.