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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
fxs7576_02
Helper I
Helper I

Problem with Refreshing Dataset after Parameter Change with Service Principal

Hi PowerBI Community,

 

I have a few semantic models (sourced from AWS/GCS and not via. Gateway) that are not owned by Service Principal. My goal is to programmatically change some parameters that the semantic models are using and then apply the change, and these are the steps I took:

  1. Take over the dataset from the original user to Service Principal. The Service Principal must the dataset owner to update the parameter. (endpoint)
  2. Update the parameter of the dataset (endpoint)
  3. Refresh the dataset to apply the parameter change to the dataset. (endpoint)

fxs7576_02_0-1732746415507.png

 

But on step 3, I always receive the following message, and most of the dataset settings are greyed out.

"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."

 

fxs7576_02_1-1732746566009.png

 

 

Does anyone know another way to change and apply the new parameter using REST API, or solve the refresh issue on step 3 (maybe allowing Service Principal to refresh any semantic models regardless of the ownership in the workspace)?

 

Best regards

 

 

5 REPLIES 5
v-yiruan-msft
Community Support
Community Support

Hi @fxs7576_02 ,

Base on your description, it sounds like you're running into an issue with data source credentials after you update the parameters and try to refresh the dataset. Please check if the service principal hit the following limitations:

vyiruanmsft_0-1732785911167.png

In addition, the following link is the one which has the similar problem as yours. Hope its solution can help you solve the problem.

Solved: Dataset refresh error Service principal - Microsoft Fabric Community

Best Regards

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

Hi @v-yiruan-msft ,

 

I don't think the Service Principal is facing those limitations.

 

When I looked at the solution in Solved: Dataset refresh error Service principal - Microsoft Fabric Community thread, they used the endpoint to update the datasource credential for Gateway.

$BounGateway=Invoke-PowerBIRestMethod -Url "groups/$($workspace.id)/datasets/$($datasetid)/Default.GetBoundGatewayDataSources" -Method GET | ConvertFrom-Json

I'm not yet familiar with gateway connection. Is the above endpoint still relevant if I use a personal cloud connection (i.e. RDS MySQL) as opposed to gateway?

lbendlin
Super User
Super User

Your process is missing a step.  After a semantic model takeover all data source credentials are removed and need to be reapplied.

 

Datasets - Update Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Thanks @lbendlin .

After the 'Takeover Dataset' step, I tried the Datasources Update endpoint

https://api.powerbi.com/v1.0/myorg/groups/{workspace_id}/datasets/{dataset_id}/Default.UpdateDatasou... 

with the following request body:

 

 

{
    'updateDetails': [
        {'datasourceSelector':
         {
             'datasourceType': 'MySql',
             'connectionDetails': {
                 'server': 'demo_server_01',
                 'database': 'demo_database_01'
            }
         },
         'connectionDetails': {
             'server': 'demo_server_01',
             'database': 'demo_database_01'
         }
        }
    ]
}

 


But received the following message:

 

{"error":{"code":"InvalidRequest","message":"The given connection details for selector # are invalid"}}

Is there any information in the request body that I need to add or modify?

 

Did you ever manage to find the solution to this?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors