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.
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?