Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Unanswered

Report on all Power Pages Sites

(0) ShareShare
ReportReport
Posted on by 15

Dear All

I've been asked to report on our Power Pages Sites detailing in particular the 'Security' settings (certificate/ website authentication key expiration dates etc.)

Is this something that can be done programatically? is there an API that i can use to query such information?

 

Many thanks for your time and consideration

Ed.

Categories:
  • MonkeySee Profile Picture
    15 on at
    Re: Report on all Power Pages Sites

    Many thanks @chuhailinh 

    Generating a token and sending it to https://api.powerplatform.com/powerpages/environments/{environmentId}/websites?api-version=2022-03-01-preview did indeed result in some information regarding the website being sent back!!.... but sadly not the piece of information i wanted 😢

    I was specifically after the expiration date of the 'Website Authentication Key' and similar details relating to any SSL certificates assigned.

     

    Again, Many thanks

     

  • chuhailinh Profile Picture
    16 on at
    Re: Report on all Power Pages Sites

    you should use these apis https://learn.microsoft.com/en-us/rest/api/power-platform/powerpages/websites with the token from the document that Fubar sent. apis in this document have same actions with yours but not enough fields

  • MonkeySee Profile Picture
    15 on at
    Re: Report on all Power Pages Sites

    Hi @Fubar 

    Good News! With the help of that article you provided, i'm able to generate a bearer token using my azure app.

    Bad News... when i use that bearer token to query the endpoints (for example:

    "Message""Authorization has been denied for this request."

    I'm assuming my app doesn't have the correct permissions set out in the 'scp:' of the bearer token. Does anyone know what api permissions my app needs to be able to query the portals and powerpages?

    In an attempt to get it working, i set the following api permissions on the app:

    MonkeySee_0-1718268746708.png

    Sadly, those permissions don't seem enough 😞

     

  • MonkeySee Profile Picture
    15 on at
    Re: Report on all Power Pages Sites

    Many thanks for your input @Fubar I'll take a look and see if i can make it work using the info

    With much appreciation,

    MonkeySee

  • chuhailinh Profile Picture
    16 on at
    Re: Report on all Power Pages Sites

    Hi @Fubar , I tried it with this api https://learn.microsoft.com/en-us/rest/api/power-platform/powerpages/websites/get-website-by-id, but when I used service principal flow to get access token the api will not work, it is only work when I used user name password flow to get access token. I am not sure the reason is this Note. Do you know the real reason?

    chuhailinh_0-1718253014785.png

     

  • Fubar Profile Picture
    7,966 Super User 2025 Season 1 on at
    Re: Report on all Power Pages Sites

    Don't know if this helps, but it is how you would get the token for other apps https://learn.microsoft.com/en-us/power-platform/admin/programmability-authentication-v2#step-5-request-an-access-token

  • chuhailinh Profile Picture
    16 on at
    Re: Report on all Power Pages Sites

    Hi @MonkeySee , thank you for your answer
    I see that for each geo location, the url is differrent, do you know how to get the mapping for geo and url

  • MonkeySee Profile Picture
    15 on at
    Re: Report on all Power Pages Sites

    Hi chuhailinh,

    No i don't have any documentation.

    I've had to work it out for myself by capturing the web traffic generated when i visit the powerplatform admin center

    regards,

  • chuhailinh Profile Picture
    16 on at
    Re: Report on all Power Pages Sites

    Hi @MonkeySee , do you have any document about this api, because I see that, seems this api url depends on the geo localtion like 'gbr' in your code snippet

     

  • MonkeySee Profile Picture
    15 on at
    Re: Report on all Power Pages Sites

    Hello Everyone

     

    Just an update as to how I'm progressing this.

     

    I've managed to cobble together quite a few PowerShell functions that get all the information I require from https://admin.powerplatform.microsoft.com 

     

    For example:

    function Get-Portal {
     [CmdletBinding()]
     param (
     [Parameter(Position=0,mandatory=$true)]
     [string] $bearerToken
     )
     $headers = @{
     'Authorization' = "Bearer $bearerToken"
     }
     $uri = "https://portalsitewide-gbr.portal-infra.dynamics.com/api/v1/powerPortal/ListPortals"
     $result = Invoke-RestMethod -Method Get -Uri $uri -Headers $headers
    
     return $result | ConvertFrom-Json
    }

    I'm just struggling with the Authorization Bearer token. Currently, I'm capturing it from my manually initiated web session and its working fine. I just want to be able to programmatically 'get' the authorization bearer token rather then the fudged solution I'm currently using. 

     

    If anyone has any ideas or resources that might help I'd be very grateful

     

    kind regards 

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43