Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Theo_MS
Advocate I
Advocate I

Publish report issue with power automate

Hello,


I am having issue to publish a report throw a power automate.

The purpose of this flow is for a public user to report (via the main service account) on a Fabric workspace via API.

 

The Fabric space has a Fabric licence and the main service account is a contributor.

The main service account has the correct rights on the app registration (Power BI Service → Dataset.ReadWrite.All and Report.ReadWrite.All).

 

The flow is configured in four parts.

Theo_MS_0-1764257409847.png

Part 1

Manually trigger a flow to drop the pbix file.

 

Part 2

HTTP - POST - Retrieve the authorisation token

with Azure authentication, app registration.

+ Set access token.

 

Part 3

HTTP - POST - Publish the report

 

‘uri’: ‘https://api.powerbi.com/v1.0/myorg/groups/{MyWorkspaceID}/imports?datasetDisplayName=@{triggerBody()...file”]?[“name”]}&nameConflict=CreateOrOverwrite’

 

‘headers’: {

‘Content-Type’: ‘application/octet-stream’,

‘Authorisation’: ‘@{variables(“access_token”)}’

}

 

‘body’: ‘@{base64ToBinary(triggerBody()?[“file”]?[“contentBytes”])} ’

 

Part 4

Creating a log entry in a SharePoint list

 

 

An error occurs in part 3

{‘code’:‘BadRequestException’,“message”:‘The request was denied, it contains illegal input: “”’}


I reproduce the flow on C# and it works.
Why cause this issue ? and how to push the report without issue ?

 

Regards,
Théo

 

 

 

1 ACCEPTED SOLUTION
Theo_MS
Advocate I
Advocate I

Here's the solution based on this article Use Power Automate HTTP Connector to Publish .pbix File Using the Power BI API – Joel Leichty


The HTTP step need the authentification by Active Directory OAuth.
Theo_MS_1-1764664961153.png

{
"$content-type": "multipart/form-data",
"$multipart": [
{
"headers": {
"Content-Disposition": "form-data; name=\"Rapport\"; filename=\"Rapport.pbix\""
},
"body": @{base64ToBinary(triggerBody()?['file']?['contentBytes'])}
}
]
}

 

 

 

 

 

View solution in original post

4 REPLIES 4
Theo_MS
Advocate I
Advocate I

Here's the solution based on this article Use Power Automate HTTP Connector to Publish .pbix File Using the Power BI API – Joel Leichty


The HTTP step need the authentification by Active Directory OAuth.
Theo_MS_1-1764664961153.png

{
"$content-type": "multipart/form-data",
"$multipart": [
{
"headers": {
"Content-Disposition": "form-data; name=\"Rapport\"; filename=\"Rapport.pbix\""
},
"body": @{base64ToBinary(triggerBody()?['file']?['contentBytes'])}
}
]
}

 

 

 

 

 

lbendlin
Super User
Super User

You will need to create and use a custom connector for the Power BI REST API calls. It is not possible to authenticate the way you are attempting to.  The custom connector will handle the authentication for you.

HI @lbendlin

thanks for your reply.

Can you elaborate a bit more ?
I have set the Power BI connector, but there is no action to import a report:

Theo_MS_0-1764574549522.png

Regards, 
Théo

You will need to create and use a custom connector for the Power BI REST API calls.

 

Custom connectors overview | Microsoft Learn

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.