This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
I am leveraging the REST API's to invoke a Dataset Takeover and Update Parameters method, however as the new owner is different to the original/publishing owner the dataset requires updated credentials before it can be refreshed. Currently I have to manually enter the missing credentials to enable a refresh.
| Data source error: | It looks like scheduled refresh failed because at least one data source is missing credentials. To start the refresh again, go to this dataset's settings page and enter credentials for all data sources. |
| Cluster URI: | WABI-NORTH-EUROPE-redirect.analysis.windows.net |
| Activity ID: | 00000000-0000-0000-0000-000000000000 |
| Request ID: | e9498bc8-a818-4d27-9b35-06a4b0e94582 |
| Time: | 2019-12-17 13:58:44Z |
My objective is to programatically script all these steps avoiding manual steps. The dataset does not use any gateways and only contains a single Azure SQL Database datasource. Is this feasible with current version of API's?
Many Thanks,
Tim.
Solved! Go to Solution.
Hi @Anonymous
You can use my Powershell script to update the data source credentials. This powershell script is internally calling PowerBI REST API's
You can read the full article here
## Take Over DataSet
Invoke-PowerBIRestMethod -Url "groups/$($workspace.id)/datasets/$($datasetid)/Default.TakeOver" -Method Post
## update data source credentials
$BounGateway=Invoke-PowerBIRestMethod -Url "groups/$($workspace.id)/datasets/$($datasetid)/Default.GetBoundGatewayDataSources" -Method GET | ConvertFrom-Json
$UpdateUserCredential = @{
credentialType ="Basic"
basicCredentials = @{
username= $username
password= "$(credentialpassword)"
}
} | ConvertTo-Json
Invoke-PowerBIRestMethod -Url "gateways/$($BounGateway.value.gatewayId)/datasources/$($BounGateway.value.id)" -Method PATCH -Body $UpdateUserCredential | ConvertFrom-Json
Download the full source code from here
Hi @Anonymous
You can use my Powershell script to update the data source credentials. This powershell script is internally calling PowerBI REST API's
You can read the full article here
## Take Over DataSet
Invoke-PowerBIRestMethod -Url "groups/$($workspace.id)/datasets/$($datasetid)/Default.TakeOver" -Method Post
## update data source credentials
$BounGateway=Invoke-PowerBIRestMethod -Url "groups/$($workspace.id)/datasets/$($datasetid)/Default.GetBoundGatewayDataSources" -Method GET | ConvertFrom-Json
$UpdateUserCredential = @{
credentialType ="Basic"
basicCredentials = @{
username= $username
password= "$(credentialpassword)"
}
} | ConvertTo-Json
Invoke-PowerBIRestMethod -Url "gateways/$($BounGateway.value.gatewayId)/datasources/$($BounGateway.value.id)" -Method PATCH -Body $UpdateUserCredential | ConvertFrom-Json
Download the full source code from here
Thank you for your response Jay. I forgot to add that my dataset is owned by a service principal (SPN) rather than a user principal. Is this approach still feasible?
Hi @Anonymous ,
Do you any update ? If my replay helps you please mark as accepted
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |