Forum Discussion

mmccarver's avatar
mmccarver
Frequent Visitor
3 years ago

Service principal as datasource credentials - Microsoft.PowerBI.Api - UpdateDatasourceAsync

Can power bi connect to Azure sql databases using managed identity or service principal? What CredentialsBase does it use? The SDK only has: Anonymous, Basic, Key, Windows, and OAuth2 

 

We are implementing a multi-tenat solution for power bi embedded in Azure. We have a service principal account. We are using the SDK to create profiles, workspaces, and import reports.

 

Each new tenant gets the same reports: ReportA, ReportB, ReportC. These .pbix files are developed on sample data and imported for each tenant added. 

 

We need to update the datasource for each report using : 

 

 

pbiClient.Gateways.UpdateDatasourceAsync

 

 

and passing something like...

 

 

          var req = new UpdateDatasourceRequest
            {
                CredentialDetails = "myServicePrincipal",
                DatabaseName = "myDatabaseName"
            };

 

 

And of course we would repeat this process for every tenant added.

 

No RepliesBe the first to reply