DenyAssignmentAuthorizationFailed' error when trying to delete the resource group

Anup Thomas 0 Reputation points
2024-12-26T18:25:45.24+00:00

I am encountering a 'DenyAssignmentAuthorizationFailed' error when trying to delete the resource group. The error message indicates that there is a deny assignment preventing the deletion.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,305 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vahid Ghafarpour 22,295 Reputation points
    2024-12-26T20:31:44.29+00:00

    The DenyAssignmentAuthorizationFailed error occurs when there is a deny assignment blocking your access to perform the deletion:

    https://zcusa.951200.xyz/en-us/azure/role-based-access-control/deny-assignments?tabs=azure-portal

    0 comments No comments

  2. Keshavulu Dasari 2,650 Reputation points Microsoft Vendor
    2024-12-27T01:41:05.52+00:00

    Hi Anup Thomas,

    Welcome to Microsoft Q&A Forum, thank you for posting your query here!

    Deny Assignment that is preventing the deletion of your resource group. This is a common issue when certain policies or assignments are in place to restrict actions on resources
    I suggest few steps you can take to troubleshoot the issue.

    Identify the Deny Assignment: Check the resource group or the specific resource to identify the deny assignment. You can do this through the Azure portal or by using Azure CLI/PowerShell.

    • Remove the Deny Assignment:
      Azure Portal: Navigate to the resource group, go to the "Access control (IAM)" section, and look for any deny assignments. If you find one, you may need the necessary permissions to remove it.

    Check for Managed Applications: If the deny assignment was created by a managed application, you might need to delete the managed application first

    https://zcusa.951200.xyz/en-us/powershell/module/az.resources/remove-azroleassignment?view=azps-13.0.0

    
    Remove-AzRoleAssignment -ObjectId <ObjectId> -Scope <Scope> -RoleDefinitionName <RoleName>
    

    Deployment Stacks: If the deny assignment was applied by a deployment stack, you might need to manage it through the deployment stack settings
    Reference: https://zcusa.951200.xyz/en-us/answers/questions/586310/deny-assignemnt.html
    https://zcusa.951200.xyz/en-us/answers/questions/1460841/how-to-delete-a-rg-that-has-a-deny-assignment-cant


    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.           
    User's image

    If you have any other questions or are still running into more issues, let me know in the "comments" and I would be happy to help you


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.