Forum Discussion

Houghs_Gwk's avatar
Houghs_Gwk
Frequent Visitor
4 years ago

Unable to refresh data when Service Princpal owns dataset

Hi!

 

We are currently encountering a situation that the dataset cannot be refreshed when it is owned by Service Principal. When we try to click "Refresh", it gives the message:

 

Data source errorScheduled refresh is disabled 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. Then reactivate scheduled refresh.

 

 

Also, due to the owner of the dataset is Service Principal, the UI of dataset setting is greyed out, the credentials cannot be edited here.

So we are trying to use REST API to update the datasource credentials. We are following the document shared by Jayendran. Everything works well until the last step of Updating credentials.

 

Summary of our situation:

  1. The data source is Cloud source which stored on Google storage, so the credential we use is "Anonymous".
    Is this correct?

 

$UpdateUserCredential = @{ 
            credentialType = "Anonymous"
            credentials = "{`"credentialData`":`"`"}"
            encryptedConnection = "Encrypted"
            encryptionAlgorithm = "None"
            privacyLevel = "Organizational"
            skipTestConnection = "True"

} | ConvertTo-Json ​

 

 

  • The application permission we are using are all available except for Tenant.Read.All & Tenant.ReadWrite.All.
  • The refresh function works when we just take over back the dataset, and check the "Skip test connection".
  • Updating data source credentials does not work and gives error (Invoke-PowerBIRestMethod: One or more errors occurred. (Response status code does not indicate success: 400 (Bad Request).)).  

 

Invoke-PowerBIRestMethod -Url "gateways/$($BounGateway.value.gatewayId)/datasources/$($BounGateway.value.id)" -Method PATCH -Body $UpdateUserCredential | ConvertFrom-Json ​

 

 

  • There is no on-premise gateway since the datasource is on cloud, so we retreive the default gateway.

 

This issue has made our progress keep pending. Can anyone share how it can be solved? Thank you so much!

 

Houghs

 

 

 

2 Replies

  • What's your rationale for making the service principal the dataset owner?

    • Houghs_Gwk's avatar
      Houghs_Gwk
      Frequent Visitor

      Hi lbendlin,

      We are using service principal for embedded (app owns data) as we have several workspaces to manage.