0
votes

I am using the VM scale set with an application gateway in an ARM template. First deploy works fine. When redeploying the template, I get an error: "A Backend Address Pool can have at most one VM scale set".

IpConfiguration /subscriptions/.../resourceGroups/.../providers/Microsoft.Compute/virtualMachineScaleSets/.../updateGroups/.../networkInterfaceConfigurations/.../ipConfigurations/... cannot reference Backend Address Pool /subscriptions/.../resourceGroups/.../providers/Microsoft.Network/applicationGateways/.../backendAddressPools/... because it contains another VM scale set. A Backend Address Pool can have atmost one VM scale set. (Code: ApplicationGatewayBackendAddressPoolCanHaveAtMostOneVMScaleSet)

What would be the root cause of this issue?

Clarification: By redeploy I mean: I want to update the existing deployment. I do not want to duplicate.

3

3 Answers

0
votes

The 'Backend address pool' is (according to Azure Resource Manager Support for Load Balancer)

these are IP addresses associated with the virtual machine Network Interface Card (NIC) to which load will be distributed.

What is happening on your deployment is you have a deployment that is trying to use the same backend address pool across two different sets of VMs.

Somewhere in your template you will have a section that is something like this

"type": "Microsoft.Network/loadBalancers",
"name": "[variables('loadBalancerName')]",
"location": "[parameters('resourceLocation')]",
"apiVersion": "[variables('networkApi')]",
"dependsOn": [
    "[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]"
],
"properties": {
    "backendAddressPools": [
        {
            "name": "[variables('backendAddressPoolsName')]"
        }
    ],

(obviously not a valid piece of JSON / template)

If you change the variable backendAddressPoolsName in the second template this will resolve the issue.

If you need to deploy this template multiple times, you could create a unique name by modifying the variable to be something like this

"backendAddressPoolsName": "[toLower(concat(parameters('BaseName'), uniqueString(resourceGroup().id)))]",

This will create a unique string based on the resource group id. Meaning you can deploy multiple resource groups from the same template without issue.

0
votes

When you're redeploying the template, what are you trying to change?

For a redeploy you don't need to specify all the VMSS properties like networking, and associated resources like app gateway, only the sku property of the VMSS and any properties which you're specifically changing.

0
votes

I contacted the Azure team and they let me know this is a bug on their side which will be fixed on the next NRP release.

Edit: This bug has been solved.