[Test Resources] Add ArmTemplateParameters to global variable#14697
[Test Resources] Add ArmTemplateParameters to global variable#14697minhanh-phan wants to merge 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
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
$ArmTemplateParametersfrom the serialized parameter bag when generating a self-contained post-deployment script.
|
The following pipelines have been queued for testing: |
| # Set global variables that aren't always passed as parameters | ||
| `$ResourceGroupName = `$parameters.ResourceGroupName | ||
| `$AdditionalParameters = `$parameters.AdditionalParameters | ||
| `$ArmTemplateParameters = `$parameters.ArmTemplateParameters |
There was a problem hiding this comment.
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.
Updating from #13968 to add
ArmTemplateParametersto global variables