Forum Discussion
Failing: CloneTileInGroupAsync() in .NET API v2
- Anonymous4 years ago
Three weeks after I opened a support ticket on this, it finally got transfered to a team with REST API expertise. And they found the solution. When constructing a CloneTIleRequest object, we need to omit the target workspace id, and instead we need to include the target dataset id (which the class calls the "model ID"). So the object declaration should be:
var cloneRequest = new CloneTileRequest
{
TargetDashboardId = newDashboard.Id,
TargetReportId = targetReport.Id,TargetModelId = targetReport.DatasetId
};In my opinion the API documentation on this is incorrect. It says: “targetModelId - string - Optional. A parameter for specifying a target model ID. When cloning a tile linked to a dataset, pass the target model ID to rebind the new tile to a different dataset.” This implies that the parameter should not be sent if a tile is linked to a report not a dataset. Our support ticket would have been unnecessary if the documentation had described the purpose of this parameter correctly. See Dashboards - Clone Tile - REST API (Power BI Power BI REST APIs) | Microsoft Docs
I appreciate Microsoft support for showing us how to solve this. I wish Power BI REST APIs were better documented. And I really wish customers could get more usefull diagnostic information with API calls fail.
Hi Anonymous ,
It seems everything is set up correctly according to your description. Some suggestions are as follows.
1. Add the Service Principal as an admin in the workspace directly rather than add the security group.
Please refer to article 5 in embed-service-principal#get-started-with-a-service-principal. We should use the Object ID.
2. The Service Principal inherit permission from the tenant rather than the Azure App permissions.
>>>Service principals inherit the permissions for all Power BI tenant settings from their security group. To restrict permissions create a dedicated security group for service principals and add it to the 'Except specific security groups' list for the relevant, enabled Power BI settings.
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous4 years agoNot applicable
Liang,
1. The service principal creates the target workspace (by calling the REST API, as stated above), so it is already an admin of the target workspace. The service principal is not an admin of the source workspace, but it belongs to a security group that is an admin of the source workspace. Why would Dashboards.CloneTileInGroupAsync() require this when it's not required by any of the other REST APIs we're calling? For instance, Reports.CloneReportInGroupAsync() doesn't require the service principal to be an adminstrator in the source workspace as long as it belongs to a security group that's an administrator in the source workspace.
2. We did this, and it didn't fix the problem.
- Anonymous4 years agoNot applicable
Liang,
It's been a week and I haven't heard anything more from you or anyone else at Microsoft. The issue is still not resolved. Can you offer any more help?
- Anonymous4 years agoNot applicable
Lianl,
It's been 25 days since I posted the issue on this forum, and no one has offered any answer. I opened a support ticket, but the Power BI support team seems to know nothing about REST APIs. I am extremely disappointed that no one from Microsoft seems to be helping us resolve this. Could you please give me some reply?