Prerequisites
- An Azure subscription
- The Azure CLI installed and authenticated, or access to the Azure portal
- Permission to create app registrations and assign roles in the subscription
Create the service principal
Use the Azure CLI to create a service principal with the Reader role scoped to your subscription:Required roles
| Role | Scope | Purpose |
|---|---|---|
Reader | Subscription | Read all resource metadata (VMs, Storage Accounts, SQL Servers, resource groups) |
Cost Management Reader | Subscription | Read billing data via the Cost Management API |
Reader role is assigned automatically by the create-for-rbac command above. To also enable billing data ingest, assign the Cost Management Reader role separately:
Connect your Azure subscription
- UI
- CLI
- API
Enter your credentials
Fill in all four values from the
create-for-rbac output:- Client ID (
clientId) - Client Secret (
clientSecret) - Tenant ID (
tenantId) - Subscription ID (
subscriptionId) - Display name — a label for this account in the InfraAudit UI
What gets synced
| Resource type | Internal type name |
|---|---|
| Virtual Machines | azure_virtual_machine |
| Storage Accounts | azure_storage_account |
| SQL Servers | azure_sql_server |
| Resource Groups | azure_resource_group |
Security notes
- Credentials are encrypted at rest using AES-GCM.
- InfraAudit never writes to your Azure subscription. All API calls are read-only.
- Azure AD app client secrets expire — by default after 2 years. Set a calendar reminder to rotate the secret before it expires, then update the provider credentials in InfraAudit under Cloud Providers → Edit.