Forum Discussion

GigaGandalf's avatar
GigaGandalf
Frequent Visitor
1 year ago
Solved

Creating a Dataset via API with service principal

Hello,

I am trying to create a dataset with the API and have been using a service principal to authenticate my other API calls. Unfortunately it looks like service principal authentication is now allowed for the push semantic model endpoint according to https://learn.microsoft.com/en-us/power-bi/developer/embedded/push-datasets-limitations . Is this correct? As my organization does not allow delegated user access to the power bi API, is there another way to access this API endpoint?

Thanks in advance.

  • Are you actually trying to create a push dataset or a normal one? 

     

    You can use the Create Item API to create a regular semantic model. The SPN will need contributor access to the target workspace

4 Replies

  • Deku's avatar
    Deku
    Super User

    Are you actually trying to create a push dataset or a normal one? 

     

    You can use the Create Item API to create a regular semantic model. The SPN will need contributor access to the target workspace

    • GigaGandalf's avatar
      GigaGandalf
      Frequent Visitor

      Hi Deku,

      thank you for your response. I was in fact not aware of the fabric API and under the impression that only the powerbi api exists. The create semantic model endpoint covers my needs.

      Now I only have to figure out how to create proper semantic model definitions 😄

  • v-karpurapud's avatar
    v-karpurapud
    Community Support

    Hi GigaGandalf 


    Thank you for reaching out to the Microsoft Fabric Community Forum.

    Thank you for Deku for your prompt response.
     

    We understand that you're encountering an issue related to creating push datasets using the Power BI REST API. As confirmed by the official Microsoft documentation, service principal authentication is currently not supported for creating push datasets via this API.
     
    Since your organization’s restriction on delegated user access, the recommended solution is to utilize the XMLA endpoint within a Power BI Premium workspace. This method allows you to programmatically create and manage datasets using a service principal, fully supporting your security requirements and enabling complex schema definitions.
     

    If Power BI Premium is not available in your environment, we suggest considering streaming datasets or dataflows in combination with a manually created dataset as alternative options.
     

    For more information, please refer to the official Microsoft Documentation related to XMLA endpoint.

    Semantic model connectivity and management with the XMLA endpoint in Power BI - Power BI | Microsoft Learn

    Automate Power BI Premium workspace and semantic model tasks with service principals - Power BI | Microsoft Learn

     

    If my response has resolved your query, please mark it as the Accepted Solution to assist others. Additionally, a 'Kudos' would be appreciated if you found my response helpful.

    Thank You!
     

    • GigaGandalf's avatar
      GigaGandalf
      Frequent Visitor

      Hi v-karpurapud,

      thank you for your response. I am aware of the XMLA Endpoint, unfortunately, I am operating in a web context and it is my understanding that the required MSOLAP library for XMLA connectivity is not available for web applications.