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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
amol8286
Regular Visitor

Unable to Update Datasource cerdentials using OAuth2 authentication

Hi

 

I'm trying to update datasource for my Power BI Reports using the " Gateways-Update Datasource" API. The Datasource is on cloud. I tried to use the below link to test it https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/updatedatasource#oauth2_credentials_exam...

 

Below are other details:

Datasource: Cloud

OAuth2 Authentication

Gateway ID and Datasource ID entered which are mandatory

Body: as given in the example from the above link. In the Ket part I have entered the Baerer Key. Also tried with Refresh Key but same error.

 

Below is the Response:

{
"error": {
"code": "DM_GWPipeline_Gateway_InvalidConnectionCredentials",
"pbi.error": {
"code": "DM_GWPipeline_Gateway_InvalidConnectionCredentials",
"parameters": {},
"details": [
{
"code": "DM_ErrorDetailNameCode_UnderlyingErrorCode",
"detail": {
"type": 1,
"value": "-2147467259"
}
},
{
"code": "DM_ErrorDetailNameCode_UnderlyingErrorMessage",
"detail": {
"type": 1,
"value": "The credentials provided for the Dynamics365BusinessCentral source are invalid. (Source at Dynamics365BusinessCentral.)"
}
},
{
"code": "DM_ErrorDetailNameCode_UnderlyingHResult",
"detail": {
"type": 1,
"value": "-2147467259"
}
},
{
"code": "Microsoft.Data.Mashup.CredentialError.DataSourceKind",
"detail": {
"type": 1,
"value": "Dynamics365BusinessCentral"
}
},
{
"code": "Microsoft.Data.Mashup.CredentialError.DataSourceOriginKind",
"detail": {
"type": 1,
"value": "Dynamics365BusinessCentral"
}
},
{
"code": "Microsoft.Data.Mashup.CredentialError.DataSourceOriginPath",
"detail": {
"type": 1,
"value": "Dynamics365BusinessCentral"
}
},
{
"code": "Microsoft.Data.Mashup.CredentialError.DataSourcePath",
"detail": {
"type": 1,
"value": "Dynamics365BusinessCentral"
}
},
{
"code": "Microsoft.Data.Mashup.CredentialError.Reason",
"detail": {
"type": 1,
"value": "AccessUnauthorized"
}
},
{
"code": "Microsoft.Data.Mashup.MashupSecurityException.DataSources",
"detail": {
"type": 1,
"value": "[{\"kind\":\"Dynamics365BusinessCentral\",\"path\":\"Dynamics365BusinessCentral\"}]"
}
},
{
"code": "Microsoft.Data.Mashup.MashupSecurityException.Reason",
"detail": {
"type": 1,
"value": "AccessUnauthorized"
}
}
],
"exceptionCulprit": 1
}
}
}

 

Kindly let me know if I have missed something....

4 REPLIES 4
giost
Frequent Visitor
giost
Frequent Visitor

Same problem here:

Re: AccessUnauthorized on Mashup engine using Gateways - Update Datasource API

 

A valid response from a MS expert would be highly appreciated. 

rahulverma
Frequent Visitor

Hi @v-qiuyu-msft Can you please check it out as we are getting the same problem while updating the credentials using the rest api and data source is Dynamics business central.

amol8286
Regular Visitor

Any inputs my above query...

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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