Consolidate network modes into a single template per OS - #7
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merges the separate
existing subnetandnew subnettemplates into one template per operating system, selected by a newnetworkModeparameter.Network modes
networkModeExistingSubnet(default)NewSubnetNewVnetWindows previously only supported an existing subnet and now supports all three modes.
Other changes
linux-router-newsubnet.bicep/.json, replaced by the consolidated template.scriptUrinow resolves safely whendeployment().properties.templateLinkis unavailable (local-file and template-spec deployments), falling back tomasterinstead of failing the deployment.tools/publish-templatespecs.shto publish both templates as versioned template specs, and extended CI to covertools/.\-NSGinstead of a shareddefault-nsg, so two routers in the same resource group no longer collide.privateIpAddress,publicIpAddressandsubnetIdoutputs.Validation
Six deployments to
DMAUSER-FDPO/ centralus, allSucceeded:clinux1NewVnetscriptUriself-resolved to the branchclinux2NewSubnetclinux3ExistingSubnet,deployPublicIpAddress=falsepublicIpAddressoutput empty, CSE succeeded via NAT gatewayclinux4NewVnetscriptUricorrectly fell back to mastercwin1NewVnetcwin2ExistingSubnetclinux1-NSGVerified on every VM: CSE
Succeeded, NICenableIPForwarding=True, correct NSG placement per mode, SSH/RDP reachable from the allowed prefix.In-guest Linux:
fwd=1 v6fwd=1 natrules=8 savedrules=22on all four (24.04 and 22.04).In-guest Windows:
fwdIfaces=2 icmp=Trueon both.End-to-end: a test VM in a UDR'd subnet egressed as
132.196.70.65—clinux1's public IP — proving forwarding and SNAT through the NVA.Resource group deleted after validation.