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.
Trying to build a step into my data pipeline that could refresh the power bi report. I have made it to this far that my AAD Client ID triggers the refresh, but it always asks my personal password, plus the mfa. Is there a way to use a service principale or something that wouldn't require a personal password?
Hi @Anonymous ,
Yes you can use the Service principal to call the Refresh API
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/refreshes
But before you call the refresh API the SPN needs to takeover the dataset, for that you can call the below API
POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/Default.TakeOver
All the above API needs to call using the SPN credentials.
Thanks for getting back to me. How did you do the authentication?
Maybe this can give you an idea: https://docs.microsoft.com/en-us/power-bi/developer/get-azuread-access-token#access-token-with-servi...
I can't explain more without knowing how you're implementing this.
I'm using the Power BI Nuget package to perform changes like yours using the Service Principal. I tried using Postman but I couldn't get the AAD token: "AADSTS500011: The resource principal named https://analysis.windows.net/powerbi/api/ was not found in the tenant named .... This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant
The implementaions goes like that: I have a personal account(Pro Lincence, which creates the native app). According to this https://docs.microsoft.com/en-us/power-bi/developer/embed-service-principal#get-started-with-a-servi...
Couldn't get the token, so now we will make a user which has no MFA and will work as a technical user, which is not good practice. We still use sp to access keyvault to get the credentials.
This is like a endless circle 🙃
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
2 | |
2 | |
1 | |
1 |