web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get Flow Runs via Powe...
Power Automate
Suggested Answer

Get Flow Runs via Powershell

(0) ShareShare
ReportReport
Posted on by 25

Hi Community, 

 

I've a challenge to shared with you, I'm facing this issue for the last three days and I'vent found any article explaining how to solve it.

 

First of all, my idea is use a Service Principal App to get a Flow Runs.

 

At the moment I've this configured ( and please ignore the name of the App 😞

 

1. In the App Registration ( Azure ) I've granted the following permissions to my App.

hugojesus_0-1697101357417.png

 

2. I created a Security Group and add my Service App as a member ( please ignore the name of the security group ) 

hugojesus_1-1697101510533.png

 

3. I add the Security Group as a Owner of my flow.

hugojesus_2-1697101661585.png

 

4.  The Script that I'm using in Powershell to connect to PowerAutomate.

I'm not receiving any error in the connection.

hugojesus_3-1697101935751.png

5. To get all Flow Runs I'm this command.

 

hugojesus_4-1697102130505.png

 

6. The result is empty.

 

Another way to get results ( Working Fine 😞

 

7. Connecting via Service Account ( my account ) and granting for the owner of the flow my account.

 

8. Using the same command as the step 5.

 

9. The result is not empty.

 

What I'm doing wrong?

Best Regards,

Hugo Jeus

 

 

 

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @hugojesus,

     

    Do any of the other Microsoft.PowerApps.PowerShell cmdlets return any results in the Power Automate API.ps script? Can you for example try and add something simple like 

     

    get-flowenvironment

     

    before the get-flowrun part of your script?

     

    Just to rule out if it is related to this specific cmdlet or if it is related to security/client cert setup.

     

    Btw, which version of the Microsoft.PowerApps.PowerShell module are you using? I assume the current one, version 1.0.32?

  • hugojesus Profile Picture
    25 on at

    Yes, if I use the following command, I get results.

    get-flowenvironment

     

  • DB_OK Profile Picture
    14 on at

    Hello Hugo,

     

    Did you get any solution? I am in the same situation

  • hugojesus Profile Picture
    25 on at

    Hi @DB_OK ,

     

    I don't found anything to help me out of this problem.

     

    I still with the same issue to solve.

     

    Sorry.

     

    Best Regards,

    Hugo Jesus

  • DB_OK Profile Picture
    14 on at

    Thank to reply hugo.

     

    We look for a workaround by making requests to graph environments with a custom connector. It's not ideal, but it allowed us to move forward.

  • Suggested answer
    ME-28051803-0 Profile Picture
    2 on at
    Adding app reg  permissions in the gui does not work. 
    TLDR;
    $appId = "CLIENT_ID_FROM_AZURE_APP"

    # Login interactively with a tenant administrator for Power Platform
    Add-PowerAppsAccount -Endpoint prod -TenantID $tenantId

    # Register a new application, this gives the SPN / client application same permissions as a tenant admin
    New-PowerAppManagementApp -ApplicationId $appId

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard