Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Pulling report for Storage Metrics on a SPO site

Posted on by

Hello,

 

I have an individual in my organization needing a report every month of where their site collection's storage is at. If possible, I'd like to set this up in Power Automate but I am not well versed in the nitty-gritty side of flow building to be able to come up with the solution myself.

 

Would anyone be able to show me a flow that would pull the storage metrics number and then send that in an email every month? It doesn't need to be in-depth or broken down to where all the data is going, I would literally just need the number of GBs currently being used at the time of each report. Something like:

 

Site Collection Storage Report: 10 out of 25 GB used

 

Thanks all!

  • Becca_Hayes Profile Picture
    Becca_Hayes on at
    Re: Pulling report for Storage Metrics on a SPO site

    Hello,

     

    Thank you for such a detailed response. However, I am unable to use the HTTP request you have shown as I do not have the proper licensing for it within my organization and it's not as simple as just asking for the licensing, unfortunately.

     

    Is there an alternative way of doing this, or would this be the only/best option?

     

    Thank you for your time.

  • Expiscornovus Profile Picture
    Expiscornovus 30,706 on at
    Re: Pulling report for Storage Metrics on a SPO site

    Hi @Becca_Hayes,

     

    In that case you can use the getSharePointSiteUsageDetail of the Graph API.

    https://learn.microsoft.com/en-us/graph/api/reportroot-getsharepointsiteusagedetail?view=graph-rest-1.0

     

    That method can output a csv with those details.

     

    Below is an example

     

    1. Add a recurrence action, in this case once a month

     

    2. Use for example a HTTP action
    This does require setting up an Azure AD app with the proper permissions, in this case Reports.Read.All

     

    Use the URI

    https://graph.microsoft.com/v1.0/reports/getSharePointSiteUsageDetail(period='D30')

     

    3. Add another HTTP action. Make sure it only run on the has failed event (via the Configure run after setting of the action). This is because the first HTTP will respond with a Redirect error with the download location of the csv 

     

    Use the expression below to use that download location

    actions('HTTP')['outputs']['headers']['Location']

     

    4. Use the content of that CSV to create a file in for example SharePoint, via the Create File action. The Body is used for the file content and I used the below for the unique file name

    StorageDetails_@{utcNow('yyyyMM')}.csv

     

    getstoragedetails_sposites.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard