Showing results for 
Search instead for 
Did you mean: 

SetAllDatasetConnectionsInGroup does not work


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);


Status: New

Hi @astefan,


I would suggest you file a support ticket here.


Best Regards,


Frequent Visitor

I have downloaded the code from\embadesetup

and i have given all the key in web.config .

I am tring to embaded the report in  dotnet application and i have set up all the all the step from 

power bi sign in ,create application name, workgroup , report ,grant permission

but when i am calling 

var reports = await client.Reports.GetReportsInGroupAsync(WorkspaceId); getting error


A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Socket Exception : SocketException (0x274c