Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

SetAllDatasetConnectionsInGroup does not work

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

 

Status: New
Comments
v-jiascu-msft
Employee

Hi @astefan,

 

I would suggest you file a support ticket here.

 

Best Regards,

Dale

Anonymous
Not applicable

I have downloaded the code from power.com\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 104.211.164.221:443


Socket Exception : SocketException (0x274c