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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
afernand0
Frequent Visitor

Cannot update Google BigQuery data source credentials using the API

I'm trying to update credentials of a BigQuery data source using the sample code from Microsoft that's available in the link below. 

I'm using a service account with basic credentials to connect to BigQuery. The username and the password works when I enter from the Power BI website. However, I get an Invalid username and password error when I enter the same credentials to the webapp that the sample python code launches.
I'm using a service principal to authenticate with the Power BI REST API and it is an admin for both gateway and connection. Much appreciated if someone could shed some light on to what's causing the issue.


Sample Code: https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/Python

Error:

 

 

 

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

 

 

 



2 ACCEPTED SOLUTIONS
marconiqavi
Frequent Visitor

afernand0
Frequent Visitor

Yes, the sample code sends the JSON key as an f string which formats the key. Changing that to a raw string fixed the problem.

View solution in original post

2 REPLIES 2
afernand0
Frequent Visitor

Yes, the sample code sends the JSON key as an f string which formats the key. Changing that to a raw string fixed the problem.

marconiqavi
Frequent Visitor

Did you fix it?

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.