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
m1417
Regular Visitor

Data source is not getting Updated using patch method

Hello,

For a pbi with datasource mode Import, I'am able to change the Username and Password but not able to change ConnectionString.

For my test

If I only change DataModelDataSource\Username and DataModelDataSource\Password its OK (200)

If I change ConnectionString its 400 Bad Request

 

I have to change others attributes in my Body?
Here the body:
[
        {
            "Id""uid",
            "Name"null,
            "Description"null,
            "Path"null,
            "Type""DataSource",
            "Hidden"false,
            "Size"0,
            "ModifiedBy""me",
            "ModifiedDate""2022-01-21T12:07:41.557+01:00",
            "CreatedBy""me",
            "CreatedDate""2022-01-21T09:31:56.927+01:00",
            "ParentFolderId"null,
            "IsFavorite"false,
            "IsEnabled"true,
            "ConnectionString": "XXXservernameXXX;XXXdatabasenameXXX",
            "DataSourceType""SQL",
            "IsConnectionStringOverridden"true,
            "IsReference"false,
            "DataSourceSubType""DataModel",
            "CredentialsByUser"null,
            "CredentialsInServer"null,
            "DataModelDataSource": {
                "Type""Import",
                "Kind""SQL",
                "AuthType""UsernamePassword",
                "SupportedAuthTypes": [
                    "Windows",
                    "UsernamePassword"
                ],
                "Username": "xxx",
                "Secret": "xxx",
                "ModelConnectionName"""
            }
        }
    ]

 

1 ACCEPTED SOLUTION
hackcrr
Super User
Super User

Hi, @m1417 

You might be able to try the following body code, it will work:

[
    {
        "Id": "uid", // Replace with the actual ID of the data source
        "Name": "your_datasource_name",
        "Description": "your_description",
        "Path": "your_path",
        "Type": "DataSource",
        "Hidden": false,
        "Size": 0,
        "ModifiedBy": "your_username",
        "ModifiedDate": "2022-01-21T12:07:41.557+01:00",
        "CreatedBy": "your_username",
        "CreatedDate": "2022-01-21T09:31:56.927+01:00",
        "ParentFolderId": null,
        "IsFavorite": false,
        "IsEnabled": true,
        "ConnectionString": "Server=XXXservernameXXX;Database=XXXdatabasenameXXX;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;", // Example connection string
        "DataSourceType": "SQL",
        "IsConnectionStringOverridden": true,
        "IsReference": false,
        "DataSourceSubType": "DataModel",
        "CredentialsByUser": null,
        "CredentialsInServer": null,
        "DataModelDataSource": {
            "Type": "Import",
            "Kind": "SQL",
            "AuthType": "UsernamePassword",
            "SupportedAuthTypes": [
                "Windows",
                "UsernamePassword"
            ],
            "Username": "your_username",
            "Secret": "your_password",
            "ModelConnectionName": ""
        }
    }
]

 

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

View solution in original post

1 REPLY 1
hackcrr
Super User
Super User

Hi, @m1417 

You might be able to try the following body code, it will work:

[
    {
        "Id": "uid", // Replace with the actual ID of the data source
        "Name": "your_datasource_name",
        "Description": "your_description",
        "Path": "your_path",
        "Type": "DataSource",
        "Hidden": false,
        "Size": 0,
        "ModifiedBy": "your_username",
        "ModifiedDate": "2022-01-21T12:07:41.557+01:00",
        "CreatedBy": "your_username",
        "CreatedDate": "2022-01-21T09:31:56.927+01:00",
        "ParentFolderId": null,
        "IsFavorite": false,
        "IsEnabled": true,
        "ConnectionString": "Server=XXXservernameXXX;Database=XXXdatabasenameXXX;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;", // Example connection string
        "DataSourceType": "SQL",
        "IsConnectionStringOverridden": true,
        "IsReference": false,
        "DataSourceSubType": "DataModel",
        "CredentialsByUser": null,
        "CredentialsInServer": null,
        "DataModelDataSource": {
            "Type": "Import",
            "Kind": "SQL",
            "AuthType": "UsernamePassword",
            "SupportedAuthTypes": [
                "Windows",
                "UsernamePassword"
            ],
            "Username": "your_username",
            "Secret": "your_password",
            "ModelConnectionName": ""
        }
    }
]

 

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

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.