How to automate the process of export and download of review set in Microsoft purview using API

Casepoint Developer 66 Reputation points


I got documentation that states how we can automate the process of exporting and downloading of review set in Microsoft Purview without interrupting with sign-in page.

Documentation link:

User's image

I have completed Step1 & Step2 by creating Service Principal and adding scope to my client APP from resource service principal using API (POST

Documentation link:

I am not getting Step3 & Step4, I am not getting how to approve the request by tenant admin and where to pass scope and header ("X-AllowWithAADToken", "true");


Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
997 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,078 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vasil Michev 98,196 Reputation points MVP

    When you add the scope to your custom app, you need to also grant admin consent to it, otherwise any attempt to obtain a token will trigger the admin consent prompt. After consent is granted, use your custom app to obtain an access token (for the specified resource, b26e684c-5068-4120-a679-64a5d2c909d9). Then add it to your curl/Invoke-WebRequest request, along with the X-AllowWithAADToken header.

    I posted some more detailed instructions here, if the above is not clear: