It is not possible to remove Load Balancer due to Deny Assignment

DimaH 0 Reputation points
2025-04-24T18:40:37.0233333+00:00

hi

I have faced a problem when deleting Load Balancer and Public IP resources in one of my resource groups. The error looks like this:

Failed to delete load balancer 'lb-name'. Error: The client '******@SomeOrg.onmicrosoft.com' with object id '6744e94e-f29a-4f37-ad20-0c5e30960f44' has permission to perform action 'Microsoft.Network/loadBalancers/delete' on scope 'ME_RGname/providers/Microsoft.Network/loadBalancers/lb-name'>lb-name'; however, the access is denied because of the deny assignment with name 'Container Apps Managed Resource Group Deny Assignment 56db925f-38fa-42ba-a169-dda25d628198' and Id '56db925f38fa42baa169dda25d628198' at scope '/subscriptions/XXXYYY/resourceGroups/ME_RGname/providers/Microsoft.Network/loadBalancers/lb-name'.

The main problem is that Deny assignment is in read-only mode and even if you have subscription owner or global administrator rights, there is no way to delete it.

The same Deny assignment is assigned to the resource group in which Load Balancer is located and is inherited by all nested resources, including Public IP.

I have already attempted to remove these resources using Azure deployment stacks, but it didn't help as the error keeps recurring.

Do you have any ideas how to remove these resources?

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
625 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. TP 118.5K Reputation points
    2025-04-24T19:23:46.25+00:00

    Hi,

    Certain Azure services create a resource group containing managed infrastructure resources. You can't delete these resources directly, rather, you must delete the resource that requires them and they will be automatically deleted.

    By default, when you create Azure Container Apps Workload profiles environment deployed into your own virtual network, a resource group starting with ME_ is created to contain infrastructure resources (Azure Load Balancer is one of the resources).

    If Container Apps is the reason the resources exist and you no longer need it, you may consider deleting so that the related managed resource group (and its resources) will be removed. Please make certain you are no longer using before deleting.

    Managed resources

    https://learn.microsoft.com/en-us/azure/container-apps/networking?tabs=workload-profiles-env%2Cazure-cli#managed-resources

    Please click Accept Answer and upvote if the above was helpful. If something is unclear please add a comment below.

    Thanks.

    -TP


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.