Forum Discussion

withnoe's avatar
withnoe
Frequent Visitor
1 year ago
Solved

DataSource.Error: Web.Contents with the Content option is only supported when connecting anonymously

I am getting the error " query. DataSource.Error: Web.Contents with the Content option is only supported when connecting anonymously."  when trying to impliment this suggested article https://pbi-guy.com/2023/03/25/connect-with-power-bi-to-the-power-bi-rest-api-with-a-service-principal/#8230 to create a report that connects with Power BI to the Power BI REST API with a Service Principal.  I have checked my permissions and they are set to anonymous.  What am I missing?

 

 

Here is a link to download the report used on this page  https://github.com/PBI-Guy/blog/blob/main/Connect%20with%20Power%20BI%20to%20the%20Power%20BI%20REST%20API%20with%20a%20Service%20Principal/SP%20Get%20all%20Workspaces.pbit

Just click on the download icon.

 

  • I could not get it to work correctly.   I think it might have to do with the fact that the organization that I work for doesn't have a premier license.  However, I found a custom connector that will connect to the Power BI API's automatically.  https://github.com/migueesc123/PowerBIRESTAPI

3 Replies

  • withnoe's avatar
    withnoe
    Frequent Visitor

    I could not get it to work correctly.   I think it might have to do with the fact that the organization that I work for doesn't have a premier license.  However, I found a custom connector that will connect to the Power BI API's automatically.  https://github.com/migueesc123/PowerBIRESTAPI

  • - make sure the token is  usable (no delegated permissions!) - check at jwt.io

    - make sure the service principal is added to the artifact you are trying to query

  • v-nmadadi-msft's avatar
    v-nmadadi-msft
    Community Support

    Hi withnoe  ,

    Please check this documentation
    Automate Power BI Premium workspace and semantic model tasks with service principals - Power BI | Microsoft Learn
    especially this part

     

     


    And most importantly

     

     


    and complete the workspace access part which is right below enable service principals.

    Hope these suggestions will help you and please reach back if you have any further questions.
    Did I answer your question? Mark my post as a solution, this will help others!

    If my response(s) assisted you in any way, don't forget to give "Kudos"

    Thanks and Regards