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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

PowerbI dataflow import REST API

Hi,

Can you please help with the clear instructions on how to import dataflow using rest API.The documentation is not starightforward and seems to have gaps.

Thanks,

Mudit

Status: New
Comments
v-yuta-msft
Community Support

@Anonymous ,

 

I would suggest you refer to tutorial and doc below:

https://www.youtube.com/watch?v=rN1WbsD9T1I

https://docs.microsoft.com/en-us/rest/api/power-bi/dataflows/getdataflows

 

Regards,

Jimmy Tao

Anonymous
Not applicable

@v-yuta-msft 

https://www.youtube.com/watch?v=rN1WbsD9T1I

--> This link doesn't help as it shows manual process of Import.I am looking for import using REST API.

https://docs.microsoft.com/en-us/rest/api/power-bi/dataflows/getdataflows

--> This also doesn't help as i'm looking for import dataflow json.

 

What i'm saying is below documentation for importing mode.json is not working and looks like there are gaps in this documentation.

https://docs.microsoft.com/en-us/rest/api/power-bi/imports/postimportingroup

 

Anonymous
Not applicable

Getting below error while importing

Invoke-RestMethod: {"error":{"code":"ImportSizeErrorCode","pbi.error":{"code":"ImportSizeErrorCode","parameters":{},"details":[],"exceptionCulprit":1}}}

conorh-dev
Frequent Visitor

I'm getting the same error and this post is the only reference I can find online with same error code being returned. 

Does anybody know what to check here? 

I am using an Azure DevOps pipeline with user credentials to import a dataflow via API and getting "Import failed. Code=ImportSizeErrorCode" as well. 

When I try to run the same script and dataflow locally using credentials it does import, and I can import from file when creating dataflow as the same logged in user to Power BI Embedded Service so it seems to only appear when running from pipeline. 

Thanks,
Conor

LoyosBI_Florian
Frequent Visitor

Is this solved? I also get the error code:

{"error":{"code":"ImportSizeErrorCode","pbi.error":{"code":"ImportSizeErrorCode","parameters":{},"details":[],"exceptionCulprit":1}}}

 

Thank you!

conorh-dev
Frequent Visitor

@LoyosBI_Florian 

I'm not sure about the other posts but I know that when I had the error it was actually down to a malformed model.json.

So in our configuration we do text replacements on the dataflow model.json before import, and one of our developers changed a placeholder we use for replacement which caused the model to be invalid before calling the Import API.

I would recommend manually importing your file exactly as it is to see if you receive same error as above. If it is then you most likely have an issue with your model.json

LoyosBI_Florian
Frequent Visitor

@conorh-dev  Thanks for your quick reply!

 

Yeah I also thought about that. I tested in two ways:
1. Exporting a model.json from a working dataflow and using it in power automate (The model.json works when I upload it manually in the web service).

2. Getting the json definition directly in Power Automate via the Get Dataflow REST API

 

However the error occurs in both cases and also with different Dataflows. Its even the case if there is only one Dummy table in the dataflow so I really dont know how to approach this.

Maybe it has something to do with the Request Body of the API Call. Im struggling there as well, as the Documentation is not really detailed. I am using the "HTTP with Microsoft Entra ID" Connector. If you still have it, could you provide the Request Body which finally worked for you? Thank you so much!