Landing zone on an existing subscription¶
A subscription that already exists, created in the portal, by a partner, or
inherited from before the platform, becomes a landing zone: placed under
corp or online, renamed to the convention, given a budget and a spoke
network. This is the common case, and the shape NRIT runs in its own tenant.
Example: examples/landing-zones/adopt-subscription/.


Two units, on purpose¶
| Unit | Owns | Module | Version |
|---|---|---|---|
_global/lz-vending/ |
The subscription: display name, placement under the management group, resource provider registration, the monthly budget. No network | Azure/avm-ptn-alz-sub-vending/azure |
0.3.4 |
westeurope/network/ |
The spoke: resource group, virtual network, subnets, the NSG, the hub connection, optionally the route table to a firewall | Azure/avm-ptn-alz-sub-vending/azure |
0.3.4 |
Module docs
Links point at the pinned version. The module examples are applied by the module's own CI on every release.
The same module, configured differently. Every subscription-level input is
fixed off in the network unit, so the two never contend for subscription state.
Each has its own state, so a subnet change never re-plans the placement, and
the placement unit is region-agnostic, which is why it sits under _global/
with a co-located region.hcl that only satisfies the root contract.
Identities and role assignments are deliberately not here. They belong to the workload unit that uses them, next to what they protect.
The tree you add¶
live/landingzones/corp/corp-app-prod/ # <archetype>-<purpose>-<environment>
├── subscription.hcl # the existing subscription id
├── env.hcl # environment = "prod"
├── _global/
│ ├── region.hcl # satisfies the root contract only
│ └── lz-vending/
│ ├── terragrunt.hcl # depends on _foundation/landing-zones
│ └── main.tf
└── westeurope/
├── region.hcl
└── network/
├── terragrunt.hcl # depends on the hub and on lz-vending
└── main.tf
Corp versus online is subscription_management_group_id in lz-vending, and
the folder it sits under. Nothing else differs.
Decisions in the example¶
- Adopt, do not vend.
subscription_alias_enabled = falsewith the id fromsubscription.hcl.subscription_update_existing = trueis what makes the display name take effect; without it the name is inert. - Subscription tags stay unmanaged. An empty
subscription_tagsmap. The ALZ inherit-tag policy copiesbusinessunit,envandcostcenterfrom the subscription onto every resource group that lacks them, so setting them here restamps the whole subscription. The resource groups carry the house tag block instead. - Providers registered here. The root provider block registers nothing,
and a delegated subnet or a key vault fails on a subscription that has not
registered its namespace. The list grows with the workloads.
Microsoft.AlertsManagementandmicrosoft.insightsstay on it for every subscription, because AMBA's alert processing rules need them. - A budget with two alerts. Actual at 80 percent and forecast at 100 percent of a monthly amount, to whoever holds Owner. No address in code.
The spoke¶
The example's spoke is one /24 with two subnets, each associated to one
network security group, because the ALZ policy Deny-Subnet-Without-Nsg
denies any subnet without one.
| Subnet | For |
|---|---|
snet-app-workload-prod-weu, /26 |
Private endpoints and anything without a delegation |
snet-app-appsvc-prod-weu, /26 |
App Service regional VNet integration: delegated to Microsoft.Web/serverFarms, shared with nothing else |
A Flex Consumption function app needs a third subnet delegated to
Microsoft.App/environments; the workload PR adds it when needed.
The hub connection is the only line that changes between connectivity scenarios:
| Hub | In main.tf |
|---|---|
| Hub and spoke (minimal or firewall) | hub_network_resource_id, hub_peering_enabled = true, use_remote_gateways = false because the hub has no gateway |
| Hub and spoke with firewall, egress inspected | Also route_table_enabled = true and route_table = { key_reference = "to_firewall" } on each subnet; the next hop is the firewall's first usable address, a literal by convention |
| Virtual WAN | The commented virtual hub locals and vwan_connection_enabled block instead of the hub virtual network locals and the peering lines, and the unit's dependencies pointed at caf-connectivity-vwan |
The hub's resource id is derived from the connectivity subscription id, the hub resource group and the hub name the hub unit uses, so it is known at plan time and reads no state. The connectivity subscription is not an ancestor of this folder, so its id is a literal to replace.
Set tags on the virtual network as well as on the resource group. The ALZ
inherit-tag policy copies them at run time, so a VNet with no tags in code
drifts on every plan.
Apply order¶
lz-vending first, then network. Both depend on the foundation, and the
network depends on the hub. Comment tfpr apply once; the engine orders them.
What people get wrong¶
- Remote gateways. The hub has no VPN or ExpressRoute gateway, so the
peering must set
use_remote_gateways = false. The module default istrue, and the peering fails against a gateway-less hub. - A subnet without an NSG. Denied by policy at apply, not at plan.
- Renaming the folder. The folder is the state key. Moving a landing zone folder is a state move; see the runbook.