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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
venkaiah949881
Frequent Visitor

Update Data source Credentials using Rest API

Hi Team,

 

I am trying to update the Azure Analysis service data source credentials using rest api but I am getting the below error. Can any one help me to fix the issue.

 

PATCH https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}

 

{ "credentialDetails": { "credentialType": "OAuth2", "credentials": "{\"credentialData\":[{\"name\":\"accessToken\", \"value\":\"eyJ0....fwtQ\"}]}", "encryptedConnection": "Encrypted", "encryptionAlgorithm": "None", "privacyLevel": "None" } }

 

{
  "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 AnalysisServices source are invalid. (Source at )"
          }
        },
        {
          "code": "DM_ErrorDetailNameCode_UnderlyingHResult",
          "detail": {
            "type": 1,
            "value": "-2147467259"
          }
        },
        {
          "code": "Microsoft.Data.Mashup.CredentialError.DataSourceKind",
          "detail": {
            "type": 1,
            "value": "AnalysisServices"
          }
        },
        {
          "code": "Microsoft.Data.Mashup.CredentialError.DataSourcePath",
          "detail": {
            "type": 1,
            "value": "data source server deatils"
          }
        },
        {
          "code": "Microsoft.Data.Mashup.CredentialError.Reason",
          "detail": {
            "type": 1,
            "value": "AccessUnauthorized"
          }
        },
        {
          "code": "Microsoft.Data.Mashup.MashupSecurityException.DataSources",
          "detail": {
            "type": 1,
            "value": "[{\"kind\":\"AnalysisServices\",\"path\":\"server detials\"}]"
          }
        },
        {
          "code": "Microsoft.Data.Mashup.MashupSecurityException.Reason",
          "detail": {
            "type": 1,
            "value": "AccessUnauthorized"
          }
        }
      ],
      "exceptionCulprit": 1
    }
  }
}

 

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @venkaiah949881 

Please check if below documents could help.

https://learn.microsoft.com/en-us/rest/api/power-bi/gateways/update-datasource 

https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/update-datasources#datasourceconnection... 


I would recommend you arise your question in this Power BI Developer for expert assistance.

This is a specific channel related to issues with Power BI Rest APIs.

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.