Issue: Power BI report throws error "principalobjectattributeaccessset" while refreshing from Power BI Desktop.
Principalobjectattributeaccessset. Failed to save modifications to the server. Error returned: 'OLE DB or ODBC error: Exception of type 'Microsoft.Mashup.Engine.Interface.ResourceAccessForbiddenException' was thrown.. '.
Data Source: Dynamics CRM connected through OData feed.
Cause: The error originates from data source “Dynamics CRM” and can be confirmed, if we collect a Fiddler trace. We would be able to see the below details: -
Frame 154: Error 403
GET /api/data/v9.1/principalobjectattributeaccessset?$select=principalobjectattributeaccessid%2C_principalid_value%2Creadaccess%2Cattributeid%2Cversionnumber%2Cupdateaccess%2C_organizationid_value%2C_objectid_value HTTP/1.1
message=Principal user (Id=XXX, type=8, roleCount=4, privilegeCount=539, accessMode=0), is missing prvReadPrincipalObjectAttributeAccess privilege (Id=XXX) on OTC=44 for entity 'principalobjectattributeaccess'. context.Caller=XXX
Assign the CRM System Administrator Role to the user trying to refresh report in Power BI Desktop. In this case, the customer has refreshed all previous reports in Desktop and then reverted the sys admin change.
The additional recommendation is to create a custom role in Dynamics for, let’s say, “PBI Reports Admin”, where you can customize what the user can do from a Read-Write-Update perspective on the records.
References on how to assign CRM System Admin Role: -