Managed identity doesn't allow permissions to join subnet, but it's owner on that vnet/subnet

Diko Parvanov 0 Reputation points
2025-01-15T15:16:37.7533333+00:00

I have an Azure managed application, deployed from the Azure Marketplace with an ARM template and with a managed identity assigned to a VM, that lives in the managed resource group. The managed identity has Owner permissions over the resource group so it should be able to do anything - I can create/delete vnets/subets with az cli freely.

This dfa2e8dd-df89-40e2-bbb2-9b77cdcb4d7c is the VM object managed identity.

Now I am trying to add backend servers to an application gateway backend pool using:

az network application-gateway address-pool create --gateway-name $APP_GATEWAY_NAME -n mybackendpooltest -g $RG --servers $IPS

What I am getting back is:

(ApplicationGatewayInsufficientPermissionOnSubnet) Client with object id dfa2e8dd-df89-40e2-bbb2-9b77cdcb4d7c does not have permission on the Virtual Network resource /subscriptions/XXXXXXXXXXXXX/resourceGroups/YYYYYYYYYYYYYY/providers/Microsoft.Network/virtualNetworks/AppGatewayVnet/subnets/AppGatewaySubnet to perform action Microsoft.Network/virtualNetworks/subnets/join/action. For details on the required permissions, please visit https://aka.ms/agsubnetjoin.

When I run the same command with the external tenant that has full access over the managed application - the command succeeds. I have the same permissions as the external object (Owner) of the resource group and all resources.

I tried manually assigning this system managed identity explicit access over the Vnet and Subnet with:

  • "Network Contributor" role - no help
  • "Domain Services Contributor" - no help
  • "Owner" role - no help

The reason I am adding the backend servers later on are that during the ARM template deployment the machines are not known yet and are created afterwards.

What can I do to unblock this?

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,109 questions
Azure Managed Applications
Azure Managed Applications
An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.
160 questions
0 comments No comments
{count} votes

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.