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

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

networkModeVirtual networkSubnetNSG placement
ExistingSubnet(default)Must existMust existOn the NIC, so an existing subnet NSG is never overwritten
NewSubnetMust existCreatedOn the new subnet
NewVnetCreatedCreatedOn 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:

DeploymentModeSourceResult
Linux clinux1NewVnetraw branch URLscriptUri self-resolved to the branch
Linux clinux2NewSubnetraw branch URLUbuntu 22.04
Linux clinux3ExistingSubnet, deployPublicIpAddress=falseraw branch URLpublicIpAddress output empty, CSE succeeded via NAT gateway
Linux clinux4NewVnettemplate specscriptUri correctly fell back to master
Windows cwin1NewVnetraw branch URLServer 2025
Windows cwin2ExistingSubnetraw branch URLNSG 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 masterAug 13, 2026
2 checks passed
Sign up for freeto 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

@dmauser