Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

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 pred...
  • ibarrau's avatar
    ibarrau
    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/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,