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.

Reply
JasonAkin
Frequent Visitor

Publishing PBIX file progammatically

Hi I am trying to figure out how to programmatically publish a .pbix file that is using a dataset that is already published. So the PBIX file is just the report. I keep getting the below error. Does this work differently for reports that are using the POWER BI Dataset or can anyone point me in the right direction.

 

{StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
X-PowerBI-Error-Info: PowerBIModelNotFoundException
X-PowerBI-Error-Details: {"error":{"code":"PowerBIModelNotFoundException","pbi.error":{"code":"PowerBIModelNotFoundException","parameters":[],"details":[],"exceptionCulprit":1}}}
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Frame-Options: deny
X-Content-Type-Options: nosniff
RequestId: cbf2b647-72c4-4bfa-bde2-d0d7ddea3e63
Date: Wed, 19 Sep 2018 18:26:07 GMT
Server: Microsoft-HTTPAPI/2.0
Server: Microsoft-HTTPAPI/2.0
Content-Length: 153
Content-Type: application/json; charset=utf-8
}}

 

 

 

This is what I am sending

Headers = {Content-Type: multipart/form-data; boundary="be37b6e7-112c-4015-ad31-d1e68d4a9e36"
Content-Length: 14399
}

1 ACCEPTED SOLUTION

I finally got it to work and wanted to post my solution.

 

I had to change the url passed by adding in myorg/groups as well as the GUID of the App that I wanted to publish to.

 

"https://api.powerbi.com/v1.0/myorg/groups/[guid]"

View solution in original post

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @JasonAkin,

 

Based on my research, there is no limitation to programmatically publish a .pbix file live connect to Service dataset. In your scenario, please test whether you can publish the report to service successfully via clicking the "Publish" button manually.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Yes I have had no issue publishing it manually. I am working with the project from github 

https://github.com/criticalpathtraining/pbixinstallerforpowerbi

I am able to see all my workspaces contents but having an issue with the import.

 

My company receintly decided to give access to users to manage and change reports but do not want them publishing so we are trying to set up an automated process that will publish and archive the file so that we have a history or receint changes. 

I finally got it to work and wanted to post my solution.

 

I had to change the url passed by adding in myorg/groups as well as the GUID of the App that I wanted to publish to.

 

"https://api.powerbi.com/v1.0/myorg/groups/[guid]"

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors