Power Automate and Power BI Rest API

Last modified date

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.

Final Power Automate Flow

The final flow, after post 5, fetches the Service Principal credentials using a child flow, then uses HTTP action to create the workspace and with a bit of parse json action magic uses another HTTP action to change the permissions.

5 step flow as described in the previous paragraph

The above flow has flaws, no error handling, no checking the workspace name is allowed and no notifying the admin they have a new workspace.

Next Steps

This is a simple example of using Power Automate with Power BI rest API to perform some admin tasks. This could easily be extended to include other boring admin tasks.

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