Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Is it possible to use the Power BI V2 API to update connection details (e.g. set the connection username and password) using the Nuget package Microsoft.PowerBI.Api 2.0.10? Primarily interested in setting the connection details of either Azure SQL or Azure Table Storage connections in PBIX that I have imported through my custom front-end.
This package has namespaces for both the V1 and V2 APIs... are the issues with using both in an application?
Hi @jimmcslim,
Have you tried using the UpdateDatasourceAsync function within Nuget package Microsoft.PowerBI.Api to update cloud source credentials in your scenario? The code below is for your reference.
var credentialDetails = new CredentialDetails(); credentialDetails.CredentialType = "Basic"; credentialDetails.Credentials = ""; var updateDatasourceRequest = new UpdateDatasourceRequest(credentialDetails); await client.Gateways.UpdateDatasourceAsync("gatewayId", "datasourceId", updateDatasourceRequest);
Regards
Sorry, but your sample doesn't really help me.
In the context of an Azure SQL (not Analysis Services, and not on-prem) or Azure Table Storage datasource, what should be the value of gatewayId and datasourceId? How do I use the REST API/Nuget package to get these values? I have tried to use the IPowerBIClient.Groups, IPowerBIClient.Reports, and IPowerBIClient.Datasets APIs to enumerate the objects and while I can lookup groups, reports and datasets, there are no datasources linked to my dataset and no gateways in my IPowerBIClient.Gateways call.
Maybe best to take the discussion to the linked issue below, which was similar to a question of mine.
https://community.powerbi.com/t5/Developer/Patching-an-Online-DirectQuery-datasource/m-p/351230
(Unfortunately it appears my response to the above thread has been squashed).
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
1 | |
1 | |
1 |