Skip to content

[Test Resources] Add ArmTemplateParameters to global variable#14697

Open
minhanh-phan wants to merge 2 commits intomainfrom
fixArmTemplate
Open

[Test Resources] Add ArmTemplateParameters to global variable#14697
minhanh-phan wants to merge 2 commits intomainfrom
fixArmTemplate

Conversation

@minhanh-phan
Copy link
Copy Markdown
Member

@minhanh-phan minhanh-phan commented Mar 24, 2026

Updating from #13968 to add ArmTemplateParameters to global variables

@minhanh-phan minhanh-phan requested a review from a team as a code owner March 24, 2026 20:48
Copilot AI review requested due to automatic review settings March 24, 2026 20:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds ArmTemplateParameters to the set of globals emitted into the self-contained post-deployment script generated by New-TestResources.ps1, ensuring post scripts can access ARM template parameter inputs even when not passed explicitly as parameters.

Changes:

  • Set $ArmTemplateParameters from the serialized parameter bag when generating a self-contained post-deployment script.

@azure-sdk
Copy link
Copy Markdown
Collaborator

The following pipelines have been queued for testing:
java - template
java - template - tests
js - template
net - template
net - template - tests
python - template
python - template - tests
You can sign off on the approval gate to test the release stage of each pipeline.
See eng/common workflow

# Set global variables that aren't always passed as parameters
`$ResourceGroupName = `$parameters.ResourceGroupName
`$AdditionalParameters = `$parameters.AdditionalParameters
`$ArmTemplateParameters = `$parameters.ArmTemplateParameters
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copying over from https://github.com/Azure/azure-sdk-for-js/pull/37736/changes#r2989926543

What is currently done in other comparable tests is that post-script inspects the arm template deployment outputs only. I think this is a better approach because it reduces any coupling on parameters/variables that have to be consistently named and passed across yaml, powershell and arm/bicep files. For example: https://github.com/Azure/azure-sdk-for-net/blob/0acbe6a297f69e026e78a93ba6df1bf89af866a0/sdk/keyvault/test-resources-post.ps1#L36-L39

When I selected the parameters to copy over I only picked ones that were actively used across all our post scripts. I originally didn't include AdditionalParameters either until an earlier iteration of js identity, but we can probably remove it now as well.

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.

4 participants