Forum Discussion

gulce's avatar
gulce
Frequent Visitor
1 year ago
Solved

How to access Defender for Cloud Apps data and store it for long-term Power BI analysis?

🔹 1. First — How do you access Defender data at all? I'm trying to pull discovery data (e.g. which users accessed which apps, like ChatGPT) using the API. I generate a valid access token using clie...
  • v-achippa's avatar
    v-achippa
    1 year ago

    Hi gulce,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Thank you johnbasha33 for the prompt response.

     

    The API is not returning all the apps or users you see in the defender because,

    • The API call without a streamId only returns data for one stream, that is why there are only few records. And full pagination is not implemented, here the API returns results in pages so by default it may be showing only the first page records. 

    Please follow below steps:

    • Get all stream IDs from /api/discovery/streams/
    • For each streamId, call /api/v1/discovery/discovered_apps with that streamId in the request body.
    • Implement pagination by checking hasNext and use the nextQueryFilters until no more pages remain.
    • Combine results from all the streams to match the portal’s total count.

    This will return all records from all reports, matching what you see in the portal.

     

     

    Thanks and regards,

    Anjan Kumar Chippa