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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Not applicable

Error using REST API to deploy/import dataflow using Service Principal

I am trying to import/deploy a dataflow using the REST API.{groupid}/imports?datasetDisplayName=model.json&nameConfli...



The error I get is this:

  },"name":"RRao1 - Test - CRM Account Option Sets","connectionType":"import","source":"Upload","datasets":[],"reports":[]
I have tested the same code to deploy PBIX and that works. So, the SPN does have access to PowerBi and the ability to publish some files. I am just not sure why I am getting the DataflowUnauthorizedError. Other commands against dataflows (get, etc) all work.
Here is the error I get when I run it using PowerShell: The remote server returned an error: (401) Unauthorized.
Resolver II
Resolver II

Did you ever get this to work as I'm in the exact same boat as you? Looks like the only artefact type a service principal cannot deploy is a dataflow for some mad reason. I receive the error: "ALM_InvalidRequest_ServicePrincipalNotSupported"

Community Support
Community Support

HI @Anonymous,

So you mean direct upload to import data flow works, but rest API failed? If this is a case, did other rest API works on your account? I'd like to suggest you check your azure account and related permission and setting to confirm if you have the permissions to use rest API.
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Not applicable

Using the exact same api and the spn, upload is successful with a pbix file.

Using the same api and my login, upload of dataflow is successful.

Using the spn and the same api, the upload fails with a dataflow.


I have checked to make sure dataflow read write all has been set on spn via azure portal.

Hey @Anonymous - were you able to figure this one out ? I get the exact same behaviour.

Super User
Super User

Did you follow these instructions?


Required scope: Dataset.ReadWrite.All
To set the permissions scope, see

Not applicable


Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.