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.
Hi,
So the issue is as follows : we have multiple tenants, multiple databases hosted on different Azure sql hosts with different Workspaces for every tenant. Since the number of tenants is pretty big, it's not very feasible to generate a report for every tenant and then upload it to the corresponding app workspace. So we've tried to automate the whole process, based on some configs.(We have the same report for every tenant, only the data source is different). We managed to upload the same report to the corresponding app workspace, but we can't manage to programatically update the ConnectionString. It seems to be failing when we try to change the Data Source. The uploaded file retains it's original ConnectionString. Also the report is set up using DirectQuery.
Sample code:
var import = await pbiClient.Imports.PostImportWithFileAsyncInGroup(GroupId, fileStream, importName, nameConflict);//Name conflicts : Abort, Ignore, Overwrite var datasets = await pbiClient.Datasets.GetDatasetsInGroupAsync(GroupId); var latestDataset = datasets.Value.FirstOrDefault(x => x.Name == importName); var reports = await pbiClient.Reports.GetReportsInGroupAsync(GroupId); var latestReport = reports.Value.FirstOrDefault(x => x.Name == importName);
var connectionDetails = new ConnectionDetails($"Data Source={DbHost} ;Initial Catalog={DbName};Encrypt=True;TrustServerCertificate=True;PersistSecurityInfo=True;User Id={DbPowerBIUser};Password={DbPowerBIUser};MultipleActiveResultSets=true;"); var resp = await pbiClient.Datasets.SetAllDatasetConnectionsInGroupWithHttpMessagesAsync(GroupId, latestDataset.Id, connectionDetails);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.