Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Need to configure dataset authentication automatically / programmatically

When ever new dataset is onboarded into powerbi service in settings we manully setup data source authentication. Is there any way to automate this I mean if any dataset onboarded it should refer predefined credentials.

 

I saw recently anouncement that can be achived 

Use Power BI API with service principal.

https://powerbi.microsoft.com/en-us/blog/use-power-bi-api-with-service-principal-preview/

 Is there any alternate way or any custom code to achive it.

1 ACCEPTED SOLUTION

Ok. If this is just about the credentials to autenticate automatic refreshes you can use the Power Bi Rest API. It will depend on your data to know which request do you need. For example you can add new sources to gateway like this:
https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/createdatasource

If the source is the same you don't need to add. The gateway keeps the credentials.

If you are connecting to a cloud services without a gateway, you can configure the credentials with a request like this:
https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources

 

There are a lot of more in that documentation in case you want to check whatelse you can automate. Remember that PowerShell contains a built library with methods to automate too in order to avoid API. That might be a second option.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

View solution in original post

3 REPLIES 3
ibarrau
Super User
Super User

Hi. Can you explain what are you trying to do? There are different ways to use Power Bi. You can use it in the microsoft web portal known as "Service" or you can Embed it in a custom web app (additional license required). Only the second one will let you have "automatic authentication". Otherwise the Power Bi Service will always ask for a Azure AD login.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Anonymous
Not applicable

Whenever power bi reports are deployed to microsoft web portal now we are manually authenticating the dataset in settings. Now we need to automate so whenever new dataset onboarded into power bi service(microsoft web portal) it should refere predefined credentials.

Is there anyway to write custom code and deploy it into power bi service to handle it.

Ok. If this is just about the credentials to autenticate automatic refreshes you can use the Power Bi Rest API. It will depend on your data to know which request do you need. For example you can add new sources to gateway like this:
https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/createdatasource

If the source is the same you don't need to add. The gateway keeps the credentials.

If you are connecting to a cloud services without a gateway, you can configure the credentials with a request like this:
https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasources

 

There are a lot of more in that documentation in case you want to check whatelse you can automate. Remember that PowerShell contains a built library with methods to automate too in order to avoid API. That might be a second option.

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors