Forum Discussion

ryegavian's avatar
ryegavian
Frequent Visitor
11 months ago
Solved

Upload BigQuery credentials in a Semantic model, which API to use

Context:

  • I am trying to deploy PowerBI semantic model & report via API as part of a Ci-Cd on Azure Devops.
  • I am using a Service Principal, and doing the following steps: (i) deploy, (ii) take-over, (iii) upload credentials and (iv) refresh.
  • I am failing to upload credentials and thus can't refresh the semantic model (the refresh API calls itself works)
  • The semantic model uses a BigQuery datasource, the GCP credentials I am using are functionnal (they work when I upload them in the web interface here: https://app.powerbi.com/groups/me/gateways?experience=power-bi , and am able to access the BQ ressources using a connection using those credentials)
  • The azure service principal I am using has the Gateway.ReadWrite.All, Dataset.ReadWrite.All permissions and is admin of the workspace I am targeting.

I have tried the following API:

 

Question.

Which API endpoint should I use, given this is a connection to BigQuery? Am I approaching thing the right way? I do not know the PowerBI ecosystem well.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi ryegavian ,

    Thanks for reaching out to Microsoft Fabric Community and for the detailed explanation.

    As you already mentioned, based on the current documentation for REST API support, the Datasets Update Datasources API does not include BigQuery in the supported connector list: Datasets - Update Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn

     

    The Gateways Update Datasource API targets on-premises gateway connections, which does not align with BigQuery as it is a cloud connector: Gateways - Update Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Learn

     

    The BigQuery connector itself supports credential configuration directly through the Power BI or Fabric service UI as documented here: Google BigQuery connector - Power Query | Microsoft Learn.

    At this point, that continues to be the supported way to enable authentication for refresh.

     

    There is a newer Fabric endpoint for updating connection objects that includes credentialDetails in the request body: Connections - Update Connection - REST API (Core) | Microsoft Learn.

    However I did not find any Microsoft documentation or confirmed examples showing this endpoint being used to update BigQuery service account credentials specifically for semantic model refresh.

     

    In the similar community thread below, a credential error occurred when attempting this and the issue was resolved only after switching the JSON key to a raw string format instead of an f-string in the request: Solved: Cannot update Google BigQuery data source credenti... - Microsoft Fabric Community

     

    Hope this helps. Please reach out for further assistance.

    Thank you.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi ryegavian ,
      Just wanted to check if the response provided was helpful. If further assistance is needed, please reach out.
      Thank you.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi ryegavian ,

      Thanks for the update. Creating the connection once and then binding it to each newly deployed semantic model is a valid approach, especially since the connection already contains the BigQuery credentials. Using Items – Bind Semantic Model Connection fits well in CI/CD scenarios and avoids the need to update credentials programmatically each time.

       

      Thanks for sharing it here as well - this will help others who run into a similar situation.

      Feel free to reach out for further assistance.

      Thank you.