Forum Discussion

KimTutein's avatar
KimTutein
Advocate III
1 year ago
Solved

Execute DAX via. app registration and Power BI Rest API

Hi community Has anyone ever tried querying Semantic model in Fabric using Rest API and an app registration (service principle) using the client id and a secret? I am trying to use the “Datasets – ...
  • v-kpoloju-msft's avatar
    v-kpoloju-msft
    1 year ago

    Hi KimTutein,

    You're right in your understanding after assigning the Service Principal as an Admin on the workspace using the AddUserAsAdmin API, there is still one more step needed. You will also need to grant Build permissions on the specific dataset so that the Service Principal can access or create reports from it.

    The correct API for this is the one that lets you assign dataset-level permissions specifically the Build permission. This is different from just being an Admin on the workspace, as dataset access needs to be granted separately.

    You can find more details about this in the official Microsoft Learn page on semantic model (dataset) permissions here: Power BI REST APIs semantic model permissions – Microsoft Learn

    If you are having trouble opening the link, I suggest trying a different browser or using incognito mode. Sometimes corporate networks or browser cache may cause issues with Learn pages.

    Also, the general Power BI REST API overview page below can help if you're working on automation or embedding scenarios: Power BI REST APIs for embedded analytics and automation – Microsoft Learn

    Hope this helps clarify things and let me know what you find after giving these steps a try happy to help you investigate this further.

    Thank you for using the Microsoft Community Forum.