Power Automate and Power BI Rest API

Last modified date

Comment: 1

The Power BI rest api provides the ability to create a workspace. Power Automate includes an action to make a HTTP call, i.e. a rest api. So we should be able to get a flow to create a workspace. So that was my goal. Writing the first flow and getting it to work involved so many little steps I had to write blog posts so I would remember the steps.

Power BI Rest API Documentation

The documentation refers to workspaces as groups and can be found at https://learn.microsoft.com/en-us/rest/api/power-bi/groups/create-group. It states that the API can be called by a service principal profile and the required scope is Workspace.ReadWrite.All.

Screen shot from the Power BI rest api documentation

Other Settings

You also need to make some changes to Power BI tenant settings as well and I’d recommend creating a security group and using Azure Key Vault to store the credentials. That would make a very long blog post so I’m breaking it down into separate posts.

Note This is a work in progress. I will be adding posts in the next few weeks – nag me if nothing is added!

Final Power Automate Flow

The final flow fetches the Service Principal credentials using a child flow, then uses HTTP action to create the workspace and finally another HTTP action to change the permissions.

4 steps of the final flow

Next Steps

Now we understand setting up a Service Principal and using it in a HTTP action we can look at other possibilities with the rest api and at other places we could use the rest api such at documenting what workspaces exist in a tenancy. These posts will follow.

Over 20 year experience at being passionate about training, solving problems and loving a new challenge especially in the Microsoft's Power Platform suite.

1 Response

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment