> For the complete documentation index, see [llms.txt](https://docs.mechcloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mechcloud.io/cloud-computing/stateless-iac/azure/examples-resources-with-cost/microsoft.network/application-gateway.md).

# Application Gateway

{% hint style="info" %}
**Updated**: February 13, 2026
{% endhint %}

{% hint style="info" %}
These examples assume that linked resources (VNet, Subnet, Public IP) already exist in the same resource group.
{% endhint %}

## Creating a Basic Application Gateway

```yaml
defaults:
  resource_group: rg1

resources:
  - type: "Microsoft.Network/applicationGateways"
    name: "public-appgw-v2"
    api_version: "2025-05-01"
    props:
      sku:
        tier: "Basic"
        name: "Basic"
      gateway_ip_configurations:
        - name: "appgw-ip-config"
          props:
            subnet:
              id: "/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/appgw-subnet"

      frontend_ip_configurations:
        - name: "appgw-frontend"
          props:
            public_ip_address:
              id: "/providers/Microsoft.Network/publicIPAddresses/appgw-public-ip"

      frontend_ports:
        - name: "http-port"
          props:
            port: 80

      backend_address_pools:
        - name: "backend-pool"
          props:
            backend_addresses:
              - ip_address: "10.0.1.4"

      backend_http_settings_collection:
        - name: "backend-http-settings"
          props:
            port: 80
            protocol: "Http"
            cookie_based_affinity: "Disabled"
            request_timeout: 30

      http_listeners:
        - name: "http-listener"
          props:
            frontend_ip_configuration:
              id: "ref:public-appgw-v2/frontend_ip_configurations/appgw-frontend"
            frontend_port:
              id: "ref:public-appgw-v2/frontend_ports/http-port"
            protocol: "Http"

      probes:
        - name: "health-probe"
          props:
            protocol: "Http"
            path: "/"
            interval: 30
            timeout: 30
            unhealthy_threshold: 3

      request_routing_rules:
        - name: "basic-routing-rule"
          props:
            rule_type: "Basic"
            http_listener:
              id: "ref:public-appgw-v2/http_listeners/http-listener"
            backend_address_pool:
              id: "ref:public-appgw-v2/backend_address_pools/backend-pool"
            backend_http_settings:
              id: "ref:public-appgw-v2/backend_http_settings_collection/backend-http-settings"
```

### Example plan output

```
public-appgw-v2 (action: create, monthly: $22.27, change: +100%)
  => Fixed Cost (Basic) (price: $0.0225/Hr, monthly: $16.43)
  => Capacity Units (Basic) (price: $0.008/Hr, quantity: 1, monthly: $5.84)
```

## Creating a Standard v2 Application Gateway

```yaml
defaults:
  resource_group: rg1

resources:
  - type: "Microsoft.Network/applicationGateways"
    name: "public-appgw-v2"
    api_version: "2025-05-01"
    props:
      sku:
        tier: "Standard_v2"
        name: "Standard_v2"
      gateway_ip_configurations:
        - name: "appgw-ip-config"
          props:
            subnet:
              id: "/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/appgw-subnet"

      frontend_ip_configurations:
        - name: "appgw-frontend"
          props:
            public_ip_address:
              id: "/providers/Microsoft.Network/publicIPAddresses/appgw-public-ip"

      frontend_ports:
        - name: "http-port"
          props:
            port: 80

      backend_address_pools:
        - name: "backend-pool"
          props:
            backend_addresses:
              - ip_address: "10.0.1.4"

      backend_http_settings_collection:
        - name: "backend-http-settings"
          props:
            port: 80
            protocol: "Http"
            cookie_based_affinity: "Disabled"
            request_timeout: 30

      http_listeners:
        - name: "http-listener"
          props:
            frontend_ip_configuration:
              id: "ref:public-appgw-v2/frontend_ip_configurations/appgw-frontend"
            frontend_port:
              id: "ref:public-appgw-v2/frontend_ports/http-port"
            protocol: "Http"

      probes:
        - name: "health-probe"
          props:
            protocol: "Http"
            path: "/"
            interval: 30
            timeout: 30
            unhealthy_threshold: 3

      request_routing_rules:
        - name: "basic-routing-rule"
          props:
            rule_type: "Basic"
            http_listener:
              id: "ref:public-appgw-v2/http_listeners/http-listener"
            backend_address_pool:
              id: "ref:public-appgw-v2/backend_address_pools/backend-pool"
            backend_http_settings:
              id: "ref:public-appgw-v2/backend_http_settings_collection/backend-http-settings"
```

### Example plan output

```
public-appgw-v2 (action: create, monthly: $151.84, change: +100%)
  => Fixed Cost (Standard) (price: $0.2/Hr, monthly: $146.00)
  => Capacity Units (Standard) (price: $0.008/Hr, quantity: 1, monthly: $5.84)
```

## Creating a WAF v2 Application Gateway

```yaml
defaults:
  resource_group: rg1

resources:
  - type: "Microsoft.Network/applicationGateways"
    name: "public-appgw-v2"
    api_version: "2025-05-01"
    props:
      sku:
        tier: "WAF_v2"
        name: "WAF_v2"
      gateway_ip_configurations:
        - name: "appgw-ip-config"
          props:
            subnet:
              id: "/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/appgw-subnet"

      frontend_ip_configurations:
        - name: "appgw-frontend"
          props:
            public_ip_address:
              id: "/providers/Microsoft.Network/publicIPAddresses/appgw-public-ip"

      frontend_ports:
        - name: "http-port"
          props:
            port: 80

      backend_address_pools:
        - name: "backend-pool"
          props:
            backend_addresses:
              - ip_address: "10.0.1.4"

      backend_http_settings_collection:
        - name: "backend-http-settings"
          props:
            port: 80
            protocol: "Http"
            cookie_based_affinity: "Disabled"
            request_timeout: 30

      http_listeners:
        - name: "http-listener"
          props:
            frontend_ip_configuration:
              id: "ref:public-appgw-v2/frontend_ip_configurations/appgw-frontend"
            frontend_port:
              id: "ref:public-appgw-v2/frontend_ports/http-port"
            protocol: "Http"

      probes:
        - name: "health-probe"
          props:
            protocol: "Http"
            path: "/"
            interval: 30
            timeout: 30
            unhealthy_threshold: 3

      request_routing_rules:
        - name: "basic-routing-rule"
          props:
            rule_type: "Basic"
            http_listener:
              id: "ref:public-appgw-v2/http_listeners/http-listener"
            backend_address_pool:
              id: "ref:public-appgw-v2/backend_address_pools/backend-pool"
            backend_http_settings:
              id: "ref:public-appgw-v2/backend_http_settings_collection/backend-http-settings"
```

### Example plan output

```
public-appgw-v2 (action: create, monthly: $273.31, change: +100%)
  => Fixed Cost (Standard) (price: $0.36/Hr, monthly: $262.80)
  => Capacity Units (Standard) (price: $0.0144/Hr, quantity: 1, monthly: $10.51)
```
