I have been trying to use RBAC checkAccess endpoint and I am receiving a 500 error - InternalServerErrror. This is what I tried:
var rbacUri ="https://api-dogfood.resources.windows-int.net/subscriptions/{subId}/providers/Microsoft.Authorization/checkaccess?api-version=2018-09-01-preview"
var request = new RbacCheckRequest
{
Subject = new RbacCheckSubject
{
Attributes = new() { { "ObjectId", objectId } }
},
Actions = new[]
{
new RbacCheckAction
{
Id = "Microsoft.Authorization/checkAccess/action"
}
},
Resource = new RbacCheckResource
{
Id = "/subscriptions/"+subscriptionId
}
};
var response = await client.PostAsJsonAsync(rbacUri, request, cancellationToken)
Please help. Is there any other way to verify if a certain object id has permission to perform a certain action?
I have verified the objectid
has permissions via Microsoft.Authorization/permissions
. But this gives all permissions for a certain objectid
.
I had missed adding object id in attributes field under resource property, once I added it, it worked