Forum Discussion

JasonAkin's avatar
JasonAkin
Frequent Visitor
7 years ago
Solved

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
}

3 Replies

  • v-yulgu-msft's avatar
    v-yulgu-msft
    Icon for Microsoft Employee rankMicrosoft 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

    • JasonAkin's avatar
      JasonAkin
      Frequent Visitor

      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.