How to list/download file blocked by DLP?

Zbig 0 Reputation points
2025-03-07T11:06:48.05+00:00

Hello. I am developing an application that uses Graph API SDK. The application uses the oauth application access.

I am trying to download through Microsoft Graph SDK an evidence file which was blocked by Microsoft DLP.

So my need is to download files that were blocked.

As i see it is possible to list and download these files if i am logged by user who uploaded this file.

But how to do it if I am logged as application?

Currently if i list files in drive i see files that are not blocked. I would like to see them all (with blocked).

In Microsoft Admin Entra Center my application have

Role: Cloud Application Administrator
Permissions:

Mail.ReadWrite

SecurityEvents.Read.All

SecurityAlert.Read.All

Sites.Read.All

Directory.Read.All

SecurityIncident.Read.All

GroupMember.Read.All

Files.Read.All

Mail.Read

InformationProtectionPolicy.Read.All

Thanks.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,212 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sonny Gillissen 3,591 Reputation points
    2025-03-09T21:42:30.3333333+00:00

    Hi Zbig,

    Thanks for reaching out on Microsoft Q&A!

    I’m afraid that, as an application, you may not list nor download the file, as this is the nature of DLP. Data can and must not be leaked, that is why it is protected and thus can’t be downloaded by an application (as that would state a leak).

    With that said, as you do need it in your case the only way would be to move away from application permissions and switch to delegated permissions, allowing you to impersonate the DLP user thus enabling you to download the file through the API.

    Please click ‘Accept answer’ if you think my answer is helpful. Feel free to drop additional queries in the comments below!

    Kind regards,

    Sonny

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.