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
zbroinx
New Member

Power BI REST API - UpdateDatasource - Operation is not supported for selector

Hi,

I'm using PowerBI Rest API to update the datasource. (https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/updatedatasourcesingroup)

Data sources included in this dataset: SqlServer{"server":"bXXXXXX01v\\secondary","database":"XXXXX_DB"}

My JSON:

 

{
  "updateDetails": [
    {
      "datasourceSelector": {
        "datasourceType": "SQL",
        "connectionDetails": {
          "server": "bXXXXXXX01v\\secondary",
          "database": "XXXXX_DB"
        }
      },
      "connectionDetails": {
        "server": "bXXXXXXX02v",
        "database": "XXXXX_DB"
      }
    }
  ]
}

 

 

I'm getting this error:

 

{
  "error": {
    "code": "InvalidRequest",
    "message": "Operation is not supported for selector #8"
  }
}

 

 

If I change "bXXXXXX01v\\secondary" to "bXXXXXX01v\secondary" I get this:

 

{
  "error": {
    "code": "BadRequest",
    "message": "Bad Request",
    "details": [
      {
        "message": "Bad JSON escape sequence: \\s. Path 'updateDetails[0].datasourceSelector.connectionDetails.server', line 7, position 35.",
        "target": "updateDatasourcesRequest.updateDetails[0].datasourceSelector.connectionDetails.server"
      },
      {
        "message": "'updateDatasourcesRequest' is a required parameter",
        "target": "updateDatasourcesRequest"
      }
    ]
  }
}

 

 

If the original datasource is just "server": "bXXXXXX01v", it works fine.

 

What might be the problem here?

Can I use special characters in the server option?

 

 

3 REPLIES 3
Anonymous
Not applicable

Hi all,

After several weeks, microsoft support found the problem.

The PBI report was developed in v1.

To solve this:

- install latest version of PBI Desktop

- Open PBI Report

- Save As with another name

- Publish new file

After this, the error is gone.

v-lionel-msft
Community Support
Community Support

Hi @zbroinx ,

 

Please show the code corresponding to this error (masking sensitive information).

v-lionel-msft_0-1615798903531.png

 

Best regards,
Lionel Chen

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

 

Anonymous
Not applicable

This is the code I'm using in the API website:

{
  "updateDetails": [
    {
      "datasourceSelector": {
        "datasourceType": "SQL",
        "connectionDetails": {
          "server": "bXXXXXXX01v\\secondary",
          "database": "XXXXX_DB"
        }
      },
      "connectionDetails": {
        "server": "bXXXXXXX02v",
        "database": "XXXXX_DB"
      }
    }
  ]
}

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.