Forum Discussion

Theo_MS's avatar
Theo_MS
Advocate I
8 months ago
Solved

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.

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

 

 

 

4 Replies

  • 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.