Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
md 6.66 KB

How do I set up custom OAuth credentials for Azure Monitor Activity Log?

Azure Monitor Activity Log has no Composio-managed app, so you need your own Microsoft Entra ID app registration to connect it.

Create the Microsoft Entra app

  1. Sign in to the Azure portal, open App registrations, and click New registration.
  2. Enter a Name. Under Supported account types, choose an organizational option: Accounts in this organizational directory only (single tenant) or Accounts in any organizational directory (multitenant). The account you connect must belong to a tenant the app allows.
  3. Under Redirect URI, select the Web platform, enter https://backend.composio.dev/api/v1/auth-apps/add, and click Register.
  4. On the app's Overview page, copy the Application (client) ID.

Entra app Overview page with the client, object and tenant IDs censored

  1. Open Certificates & secrets and click New client secret. Add a description, choose an expiry that fits your rotation policy (for example, 180 days), and click Add. Rotate the secret before it expires.

Add a client secret panel with a description and the 180-day expiry

  1. Copy the secret Value right away. Use the Value, not the Secret ID. Azure shows the full value only once; if you lose it, create a new secret.

Client secrets list with the Value and Secret ID columns censored

  1. Open API permissions, click Add a permission, select Azure Service Management under Microsoft APIs, and choose Delegated permissions. Select user_impersonation, then click Add permissions. This permission lets the app act with the signed-in user's existing Azure rights. It doesn't create a log-reading role or narrow those rights.

API permissions page with the Add a permission button

Request API permissions panel with Azure Service Management under Microsoft APIs

Azure Service Management delegated permissions with user_impersonation selected

Configured user_impersonation permission details for Azure Service Management

  1. Keep Allow public client flows disabled on the Authentication page. This is a confidential Web client.
  2. If your tenant restricts user consent, have a tenant admin click Grant admin consent for your tenant on the API permissions page. Adding a permission to the app registration doesn't grant consent by itself.

The redirect URI you register must exactly match the oauth_redirect_uri field in your Composio auth config (default https://backend.composio.dev/api/v1/auth-apps/add).

Create the auth config in Composio

  1. In the Composio dashboard, go to Auth Configs, click Create, and select Azure Monitor Activity Log. Enter a config name and click Next.

Composio Auth Configs page with the Create button

Create Auth Config dialog with Azure Monitor Activity Log selected

Auth config name field with the Next button

  1. Select OAuth 2.0 and Your Own Credentials. Paste the Application (client) ID into Client id and the secret value into Client secret. Leave Redirect URI as shown.

Composio OAuth 2.0 form with empty Client id and Client secret fields and the v1 redirect URI

  1. Under Scopes, select the same permissions you added in Azure, then click Create Auth Config.

Composio auth config with the v1 redirect URI and the user_impersonation and offline_access scopes

  1. Open the auth config and click Connect Account. Enter the Azure Subscription ID (generic_id) and click Connect Account. Sign in with a Microsoft account that can read that subscription's Activity Log and accept the consent prompt. Leave Consent on behalf of your organization unchecked unless you're an admin granting tenant-wide consent. An unverified label is expected for a custom app without a verified publisher.

Azure Monitor auth config page with the Connect Account button

Composio connection form with the Azure Subscription ID field censored

Microsoft Pick an account page with the accounts censored

Microsoft consent prompt for Azure Resource Manager access with organization consent unchecked

Composio page confirming the Azure Monitor Activity Log connection

  1. Back on the auth config's Connected Accounts tab, confirm the account shows Active. The Enabled label at the top of the page describes the auth config, not the account.

Connected Accounts tab with the account showing Active

For the general flow, see custom auth configs.

Scopes

The default auth config requests https://management.azure.com/user_impersonation (Azure Resource Manager) and offline_access (refresh tokens). Azure RBAC still decides which subscription logs the account can read. See Microsoft's Activity Logs - List reference.

Find the subscription ID

In the Azure portal, open Subscriptions, select the subscription whose Activity Log you want, and copy Subscription ID from Overview. The signed-in user needs the Microsoft.Insights/eventtypes/values/read permission on that subscription, for example through the Monitoring Reader role.

Azure Subscriptions list with the subscription ID and billing details censored