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?
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);
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.
(Unfortunately it appears my response to the above thread has been squashed).