Coder Perfect

ARM can be used to update an existing Application Gateway.


G’day all,

I’m currently working on some basic templates for setting up new environments for a project, and everything was going swimmingly until I reached the Application Gateway.

I’m trying to connect the new backendAddressPool/httpListener/requestRoutingRule, etc. to an existing ApplicationGateway instance, similar to how we can construct a new Microsoft.Web/sites and attach it to an existing Microsoft.Web/serverfarms.

Unfortunately, these appear to be properties rather than sub resources, as I’m getting the following problems when attempting to create them:

resource appGateway 'Microsoft.Network/applicationGateways@2021-03-01' existing = {
  name: appGwName

// This resource type is not valid
resource backendPool 'Microsoft.Network/applicationGateways/backendAddressPools@2021-03-01' = {
  name: '${appName}-${environment}-backend'
  parent: appGateway
  properties: {
    backendAddresses: [
        fqdn: appServiceUrl

Can somebody confirm that updating the configuration of an existing gateway like this is indeed doable before I spend any more work on it?

Asked by Wokket

Solution #1

There are no child resources in Application Gateways. You must deploy the whole Application Gateway, including all properties, all at once. To add more httpListeners, backendAddressPools, and so on, you must first build a template with all of the existing App GW’s properties, and then add the new properties to the template.

Templates might be difficult to handle when it comes to Application Gateways. My best advice is to work with WhatIf deployments when authoring your template as it will help you to verify that none of the existing config is removed or modified accidentaly when deploying the template.

Answered by Stefan Ivemo

Post is based on