Skip to content

Cloud & infrastructure

Connect an Azure subscription read-only using an App Registration and client secret.

Azure connects with an App Registration and a client secret. A Cloud Shell script creates both, assigns read-only roles on one subscription, and prints the values to paste back.

  1. In Dave, go to Integrations → Add integration → Microsoft Azure to get the setup script. If you enter the Subscription ID first, the script targets that subscription; otherwise it uses Cloud Shell’s current one.

  2. Open Azure Cloud Shell. If it starts in PowerShell, type bash and press Enter (or pick Bash from the shell menu, top left) — the script is Bash.

  3. Check you are on the right subscription:

    Terminal window
    az account show --query id -o tsv
  4. Paste and run the script. It creates an App Registration named Dave Integration, generates a client secret, assigns Reader and Monitoring Reader, requests the Microsoft Graph Directory.Read.All permission and grants admin consent for it, then prints the four values you need.

  5. Paste them into Directory (tenant) ID, Subscription ID, Application (client) ID and Client secret. The secret is stored encrypted, and Azure shows it only once.

  6. Set a Label — see labels.

  7. Choose Connect Azure Subscription. Dave finishes connecting once the app registration and role assignments propagate, which can take a minute.

Create the App Registration yourself, assign the roles under Permissions, then collect:

Field Where
Directory (tenant) ID Entra ID → Overview
Subscription ID Subscriptions → the subscription
Application (client) ID Entra ID → App registrations → your app → Overview
Client secret that app → Certificates & secrets → New client secret → Value

Dave gets two built-in roles, scoped to the one subscription:

Reader
Monitoring Reader

The script assigns them with:

Terminal window
az role assignment create --assignee "$APP_ID" --role Reader --scope "/subscriptions/$SUBSCRIPTION_ID"
az role assignment create --assignee "$APP_ID" --role "Monitoring Reader" --scope "/subscriptions/$SUBSCRIPTION_ID"

In the portal: Subscriptions → your subscription → Access control (IAM) → Add → Add role assignment → pick Reader → Members → Select members → Dave Integration → Review + assign. Repeat for Monitoring Reader.

To resolve role-assignment principals (users, groups and service principals) to names, UPNs and guest status, Dave also gets one read-only Microsoft Graph application permission:

Directory.Read.All

The script adds it to the app (00000003-0000-0000-c000-000000000000 is Microsoft Graph, 7ab1d382-f21e-4acd-a863-ba3e13f7da61 is Directory.Read.All) and grants admin consent by assigning that app role to the app’s service principal:

Terminal window
az ad app permission add --id "$APP_ID" --api 00000003-0000-0000-c000-000000000000 --api-permissions 7ab1d382-f21e-4acd-a863-ba3e13f7da61=Role
az rest --method POST --uri "https://graph.microsoft.com/v1.0/servicePrincipals/$GRAPH_SP_ID/appRoleAssignedTo" \
--body "{\"principalId\":\"$APP_SP_ID\",\"resourceId\":\"$GRAPH_SP_ID\",\"appRoleId\":\"7ab1d382-f21e-4acd-a863-ba3e13f7da61\"}"

In the portal: Entra ID → App registrations → Dave Integration → API permissions → Add a permission → Microsoft Graph → Application permissions → Directory.Read.All → Add permissions, then Grant admin consent.

It is read-only: it cannot create, change or delete anything in Entra ID or Azure, and grants no Entra ID admin role. It is also optional — without consent the connection still works, but principals appear only as object IDs. With it, az role assignment list fills in principal names, and Dave can look up users (userType shows guests), groups, members and service principals. If consent fails, the script warns and carries on; an administrator can grant it later from API permissions, without reconnecting.

The person running the script needs to be allowed to register applications in Entra ID, and to create role assignments on the subscription — for example Owner or User Access Administrator. Granting admin consent for Directory.Read.All also needs Privileged Role Administrator or Global Administrator. Application Administrator and Cloud Application Administrator can’t consent to Microsoft Graph application permissions.

  • Review access — Subscriptions → your subscription → Access control (IAM) → Role assignments, then look for Dave Integration.
  • Revoke access to one subscription — remove both of its role assignments there.
  • Revoke Entra ID read — that app → API permissions → Directory.Read.All → Revoke admin consent.
  • Remove everything — Entra ID → App registrations → All applications → Dave Integration → Delete.
  • Rotate the secret — that app → Certificates & secrets → New client secret. Dave cannot swap the secret on an existing connection: disconnect it in Dave, connect again with the new secret, then delete the old one.

Disconnect in Dave stops Dave using the credentials immediately, but does not touch Azure: the App Registration, its secret and the role assignments stay until you delete them. The same goes for cancelling an unfinished setup — anything the script already created stays.

  • The secret expired — client secrets expire, and the health check starts failing when it lapses. Note the expiry, and rotate it as described in Manage the connection.
  • Validation takes long — confirm the app registration, client secret, and Reader role assignment exist on the subscription.
  • Dave shows principals as object IDs only — admin consent for Directory.Read.All is missing. Grant it under the app’s API permissions — see Microsoft Graph.
  • Azure rejects the credentials — check the tenant ID, client ID, and secret. Connect again re-checks the stored values; to change one, disconnect and connect with the corrected values.