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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
m-cerna
New Member

Power BI REST API - Updating Dataset datasource error

Hi,

I'm trying to use this REST call in order to update a datalake type connection in a report

- https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup

 

However I get the following error message when doing so, be it through the documention website itself or PowerShell

 

{
  "error": {
    "code": "BadRequest",
    "message": "Bad Request",
    "details": [
      {
        "message": "Error converting value \"connectionDetails\" to type 'Microsoft.PowerBI.ServiceContracts.Api.UpdateDatasourceDetails'. Path 'updateDetails[1]', line 14, position 25.",
        "target": "updateDatasourcesRequest.updateDetails[1]"
      },
      {
        "message": "'updateDatasourcesRequest' is a required parameter",
        "target": "updateDatasourcesRequest"
      }
    ]
  }
}

 

 

And here is the JSON I'm giving to the call

 

{
  "updateDetails": [
    {
      "datasourceSelector": {
        "datasourceType": "Extension",
        "connectionDetails": {
          "path": "https://<OLD-DataLake>.azuredatalakestore.net/<PATH-TO-FILE>/",
          "kind": "DataLake"
        }
      },
      "datasourceId": "<Current-GUID>",
      "gatewayId": "<Current-GUID>"
      },
      "connectionDetails": {
        "path": "https://<NEW-DataLake>.azuredatalakestore.net/<PATH-TO-FILE>/",
         "kind": "DataLake"
      }
    }
  ]
}

 

This is a format found working in this post: https://stackoverflow.com/questions/58518997/how-to-update-a-data-source-via-the-api

 

If anyone can give me a pointer to what's the issue it would great

Thanks

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @m-cerna ,

 

Based on your json code, I think you missed a "{" or wrote an extra "}". You could check the code again.

 

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

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hi @m-cerna ,

 

Based on your json code, I think you missed a "{" or wrote an extra "}". You could check the code again.

 

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

Hi @m-cerna ,

 

Has your problem been solved? Was my reply helpful to you? If the problem is resolved, you could accept the reply you like.

 

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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