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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PowerAutomate: Creatin...
Power Automate
Suggested Answer

PowerAutomate: Creating a role assignment in the scope of an environment

(0) ShareShare
ReportReport
Posted on by 2
Hi!
I'm trying to use a power automate flow to create an application user in each environment in my Microsoft Entra tenant - this points me to the "create role assignment" action under the Power Platform for Admins (V2) connector.
I've gotten to a place where in the create role assignment parameters I need to input a "scope" and cannot get it to work with the environment id (looping over environments and getting the id property).
The documentation for these actions is not very helpful, and I couldn't find example or help from copilot. Did anyone encounter this issue or something similar regarding a scope parameter?
Will help a ton, thank you!
 
For reference, the error I get when testing the flow is this:
{
    "statusCode": 400,
    "body": {
        "httpStatusCode": "BadRequest",
        "errorCode": "InvalidScopeString",
        "errorMessage": "Invalid scope string: 'Default-2502d603-9459-44ab-9344-e8856717cf17'"
    }
}
Categories:
I have the same question (0)
  • Suggested answer
    Expiscornovus Profile Picture
    33,851 Most Valuable Professional on at
     
    Have you tried using a HTTP request for this instead? Or don't you want to use a premium connector?
     
    Examples of this approach can be found over here:
     
     
    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, LinkedIn, Bluesky profile or Youtube Channel
  • SA-02031503-0 Profile Picture
    2 on at
    Hi!
    First of all thank you for trying to help!

    The thing is I want to add specific permissions to that service principal (using a custom role I import as a power-apps solution at an earlier stage). The endpoint you pinpointed always adds the system-admin role which is too high-privileged for my use case.
  • AparnaLedcor Profile Picture
    43 on at
    I am facing same issue and couldn't figure it out either. Please let me know if you were able to figure it out?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 953

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 622

Last 30 days Overall leaderboard