How to delete a RG that has a deny assignment, can't be removed

Mazen Mohamed Abdalla 20 Reputation points
2023-12-11T11:58:19.94+00:00

Failed to delete resource group aro-infra-lq0ru6wm-demoopenshift: The client 'XXXX' with object id 'YYYY' has permission to perform action 'Microsoft.Resources/subscriptions/resourceGroups/delete' on scope '/subscriptions/ZZZ/resourceGroups/NNN'; however, the access is denied because of the deny assignment with name 'KKK' and Id 'OOO' at scope '/subscriptions/ZZZ/resourcegroups/NNN'. (Code: DenyAssignmentAuthorizationFailed)

How to remove this resource group it was created automatically while i was creating an openshift cluster resource

Azure Role-based access control
Azure Role-based access control
An Azure service that provides fine-grained access management for Azure resources, enabling you to grant users only the rights they need to perform their jobs.
929 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Andreas Baumgarten 121.1K Reputation points MVP Moderator
    2023-12-11T12:06:39.88+00:00

    Hi @Mazen Mohamed Abdalla ,

    it seems there is a Deny Assignment applied to the resource. You can check this here on the resource:

    vm01_2

    This assignment was done by a Deployment Stack: Deployment stacks (Preview) It's possible to remove the Deny Assignment via PowerShell: Control detachment and deletion


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards Andreas Baumgarten


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.