How to enable API access to Microsoft Entra ID (AzureAD)?

Article ID: 518
Category: Cloud Log Monitoring
Applies to: 5.1 and later
Updated: 2024-07-23

This guide provides step-by-step instructions to enable audit log access in Microsoft Entra ID, formerly Azure Active Directory (AzureAD).


Prerequisites
  • Administrative access to Microsoft Entra ID.
  • An active subscription to Azure.
  • Necessary permissions to configure audit logging.

Enabling Audit Log Access in Microsoft Entra ID (AzureAD)

1) Sign in to the Azure Portal

  1. Go to Azure Portal - https://portal.azure.com
  2. Sign in with your administrative account.

2) Register a new application

  1. Click on Microsoft Entra ID on the left sidebar
  2. Under Manage click App registrations
  3. Then click + New registration.
  4. Enter a name for your application.
  5. Set Supported account types based on your requirements.
  6. For Redirect URI, you can leave it empty
  7. Click Register at the bottom.
  8. After the application is registered, you will be redirected to the application's overview page.

3) Get the Application (client) ID and Directory (tenant) ID

  1. Copy the Application (client) ID. This is your CLIENT_ID.
  2. On the same overview page, you will find the Directory (tenant) ID. Copy this value as your TENANT_ID.

4) Create a client secret

  1. Click on Certificates & secrets
  2. Then under the Client secrets tab click + New client secret.
  3. Provide a description for the client secret and set an expiration period.
  4. Click Add.
  5. After creating the client secret, copy the value immediately. This is your CLIENT_SECRET. Note: You won’t be able to copy this secret later, so save it securely.

5) Assign API Permissions

  1. On the left sidebar go to API permissions > Add a permission.
  2. Select Microsoft Graph.
  3. Add delegated permissions: Choose Delegated permissions or Application permissions based on your app's requirements.
  4. For accessing logs, you need permissions like:
    • AuditLog.Read.All
    • Directory.Read.All
    • Reports.Read.All
  5. After adding the necessary permissions, click Grant admin consent to allow the application to use these permissions.


Try EventSentry on-premise

FREE 30-day evaluation

Download Now