Skip to content

Consolidate network modes into a single template per OS - #7

Merged
dmauser merged 1 commit into
masterfrom
dmauser-supreme-engine
Aug 13, 2026
Merged

Consolidate network modes into a single template per OS#7
dmauser merged 1 commit into
masterfrom
dmauser-supreme-engine

Conversation

@dmauser

@dmauser dmauser commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Merges the separate existing subnet and new subnet templates into one template per operating system, selected by a new networkMode parameter.

Network modes

networkMode Virtual network Subnet NSG placement
ExistingSubnet (default) Must exist Must exist On the NIC, so an existing subnet NSG is never overwritten
NewSubnet Must exist Created On the new subnet
NewVnet Created Created On the new subnet

Windows previously only supported an existing subnet and now supports all three modes.

Other changes

  • Removed linux-router-newsubnet.bicep / .json, replaced by the consolidated template.
  • scriptUri now resolves safely when deployment().properties.templateLink is unavailable (local-file and template-spec deployments), falling back to master instead of failing the deployment.
  • Added tools/publish-templatespecs.sh to publish both templates as versioned template specs, and extended CI to cover tools/.
  • NSG is now named \-NSG instead of a shared default-nsg, so two routers in the same resource group no longer collide.
  • Templates now emit privateIpAddress, publicIpAddress and subnetId outputs.
  • README: new Network modes section, consolidated parameter tables, template spec guidance.

Validation

Six deployments to DMAUSER-FDPO / centralus, all Succeeded:

Deployment Mode Source Result
Linux clinux1 NewVnet raw branch URL scriptUri self-resolved to the branch
Linux clinux2 NewSubnet raw branch URL Ubuntu 22.04
Linux clinux3 ExistingSubnet, deployPublicIpAddress=false raw branch URL publicIpAddress output empty, CSE succeeded via NAT gateway
Linux clinux4 NewVnet template spec scriptUri correctly fell back to master
Windows cwin1 NewVnet raw branch URL Server 2025
Windows cwin2 ExistingSubnet raw branch URL NSG landed on the NIC; the shared subnet kept clinux1-NSG

Verified on every VM: CSE Succeeded, NIC enableIPForwarding=True, correct NSG placement per mode, SSH/RDP reachable from the allowed prefix.

In-guest Linux: fwd=1 v6fwd=1 natrules=8 savedrules=22 on all four (24.04 and 22.04).
In-guest Windows: fwdIfaces=2 icmp=True on both.

End-to-end: a test VM in a UDR'd subnet egressed as 132.196.70.65clinux1's public IP — proving forwarding and SNAT through the NVA.

Resource group deleted after validation.

Merge the separate existing-subnet and new-subnet templates into one
template per operating system, selected by a new networkMode parameter:

- ExistingSubnet (default): join an existing VNET and subnet, NSG on the NIC
- NewSubnet: add a subnet to an existing VNET, NSG on the new subnet
- NewVnet: create the VNET and subnet, NSG on the new subnet

Windows previously only supported an existing subnet and now supports all
three modes. Removed linux-router-newsubnet.bicep/.json, which the
consolidated template replaces.

Also:
- Make scriptUri resolve safely when deployment().properties.templateLink
  is unavailable (local file and template spec deployments), falling back
  to the master branch instead of failing.
- Add tools/publish-templatespecs.sh to publish both templates as versioned
  template specs, and cover tools/ in CI.
- Name the NSG after the VM instead of a shared default-nsg, so two routers
  in the same resource group no longer collide.
- Emit privateIpAddress, publicIpAddress and subnetId outputs.
- Update README: network modes section, consolidated parameter tables,
  template spec guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cd9ed807-66b2-43e3-8bf9-ed7eb24a46dd
@dmauser
dmauser merged commit 6742738 into master Aug 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant