Forum Discussion
Need to configure dataset authentication automatically / programmatically
- 5 years ago
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/createdatasourceIf 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/updatedatasourcesThere 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,
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,