Azure AD Audit logs rest api auditLogs/directoryAudits

Saiteja Vangala 1 Reputation point
2021-02-18T07:35:06.677+00:00

I have created a free trail account with Azure to do POC on Azure AD and while trying to fetch Azure AD audit logs using api https://graph.microsoft.com/v1.0/auditLogs/directoryAudits/ Im getting below error. { "error": { "code": "ResourceNotFound", "message": "Resource not found.", "innerError": { "date": "2021-02-18T07:32:59", "request-id": "ed730fc7-5258-42fc-b460-ab01c1eb6e01", "client-request-id": "f543fcc5-6b98-962c-c1bf-0fdb5461a6dd" } } } Im executing this in Graph Explorer.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,073 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,124 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 56,446 Reputation points
    2021-02-18T08:02:05.787+00:00

    Hello @Saiteja Vangala · Thank you for reaching out.

    In order to successfully make below call, Graph Explorer must be connected to correct Azure AD tenant.

    https://graph.microsoft.com/v1.0/auditLogs/directoryAudits/

    For this purpose, you need to sign in to Graph Explorer by using Member user account in that tenant. To create Member user account for signing in to Graph Explorer, you need to navigate to:

    Azure Active Directory > Users > +New User > Create User and create a user with UPN e.g., username@your_tenant.onmicrosoft.com.

    Once the account is created, sign into Graph Explorer using this account and make sure you have consented for below permissions to successfully call /directoryAudits.

    • AuditLog.Read.All
    • Directory.Read.All

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments