azure-ad-b2bazure-ad-powershell-v2

Grant admin consent failed for office 365 api permissions


My requirement is creating an application in Azure AD and grant Application permissions for that application and grant admin consent for those permissions.

I created an Azure Application through Azure Portal and grant few permissions:

enter image description here

I tried to grant admin consent but I get the below error

enter image description here

Please help me with this.

Thank you.


Solution

  • Please make sure to enable Audit Logs in Office365 to grant admin consent for Office 365 Management API permissions.

    Make sure to enable Audit logs for Office365 by following this MsDoc.

    Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $true
    

    After enabling you will be able to grant admin consent for Office 365 Management API permissions successfully.