Fix VMSizes-Must-Match-Template to support nested output properties#799
Draft
Fix VMSizes-Must-Match-Template to support nested output properties#799
Conversation
Co-authored-by: psah434 <114955590+psah434@users.noreply.github.com>
Co-authored-by: psah434 <114955590+psah434@users.noreply.github.com>
…and parameter naming Co-authored-by: psah434 <114955590+psah434@users.noreply.github.com>
Co-authored-by: psah434 <114955590+psah434@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix VM SizeSelector issue in nested outputs
Fix VMSizes-Must-Match-Template to support nested output properties
Feb 13, 2026
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.
The
VMSizes-Must-Match-Templatetest only checked first-level output properties, causing false negatives when VM SizeSelector references were nested 2+ levels deep.Problem
When outputs were structured with nested objects:
The test would fail with "Could not find VM SizeSelector 'vmsize' in outputs" because it only iterated top-level properties where
$out.Valueis an object, not a string.Changes
Find-OutputPropertyhelper function: Recursively traverses nested objects to locate VM SizeSelector patterns at any depth while preserving the top-level property name for template parameter matchingThe recursive function checks if a value is a string matching the pattern, or an object requiring further traversal. It returns the top-level property name (e.g., "clusters") needed for
$MainTemplateParameterslookup, not the full nested path.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
aka.ms/usr/bin/pwsh pwsh -Command Import-Module ./arm-ttk/arm-ttk.psd1 -Force; Test-AzTemplate -TemplatePath './unit-tests/VMSizes-Must-Match-Template/Pass/Nested-Outputs-2-Levels' -Test 'VMSizes-Must-Match-Template'(dns block)/usr/bin/pwsh pwsh -Command Import-Module ./arm-ttk/arm-ttk.psd1 -Force; Test-AzTemplate -TemplatePath './unit-tests/VMSizes-Must-Match-Template/Pass/Nested-Outputs-3-Levels' -Test 'VMSizes-Must-Match-Template'(dns block)/usr/bin/pwsh pwsh -Command Import-Module ./arm-ttk/arm-ttk.psd1 -Force; Test-AzTemplate -TemplatePath './unit-tests/VMSizes-Must-Match-Template/Pass/Element-Nested-In-Section' -Test 'VMSizes-Must-Match-Template'(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This section details on the original issue you should resolve
<issue_title>Can't use VM SizeSelector in nested outputs</issue_title>
<issue_description>Hello,
I have the following output object in my uidefinition.json file:
This fails validation because ARM-ttk doesn't recognize that the VM SizeSelector elements are present in the outputs when they're multiple levels deep into an object. Here's the result from using the above in a UI definition JSON:
Validation passes, however, when one level ...
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.