This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
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
}
}
}
Solved! Go to Solution.
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.
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.
Did you fix it?
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |