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.

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
14,687 questions
Microsoft Graph Explorer API
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AmanpreetSingh-MSFT 55,531 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