Azure / ResourceModules

This repository includes a CI platform for and collection of mature and curated Bicep modules. The platform supports both ARM and Bicep and can be leveraged using GitHub actions as well as Azure DevOps pipelines.
https://aka.ms/carml
MIT License
726 stars 459 forks source link

[Innersource CI Issue from Discussions] Enable azure tags in deployment validation scripts #4546

Open eriqua opened 3 months ago

eriqua commented 3 months ago

Discussed in https://github.com/Azure/ResourceModules/discussions/3489

Originally posted by **ThojoUno** August 2, 2023 We have a very restricted lab/test environment that REQUIRES Azure tags on all resource groups. Because of this, we can't perform deployment validation with the current branch. It would be quite easy to implement but requires updating every main.test.bicep template. Steps to implement: 1. update ./settings.yml, add tags environment variable Update Deployment validation section location: 'centralus' tags: '@{"Environment"="Lab";"Expiry Date"="12/31/2023";"Business Unit"="Cloud";"Owner"="Joe Thompson"}' 2. update settings.yml under .github/actions/templates/validateModuleDeployment Replace AdditionalParameters = @{} with AdditionalParameters = @{ tags=${{ env.tags }} } There are 2 instances in this file to replace. 3. update all .test/scenario/main.test.bicep files to add tags parameter for resource group resource.. Add @description('Optional. Some environments require tagging.') param tags object = {} Update // General resources // ================= resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = { name: resourceGroupName location: location tags: tags //<=== add tag parameter }
eriqua commented 3 months ago

@AlexanderSehr off the top of my head I see this option as a possible feature for the innersource CI, as strictly related to users' CI environment.

AlexanderSehr commented 3 months ago

very restricted lab/test environment that REQUIRES Azure tags on all resource groups. Because of this, we can't perform deployment validation with the current branch. It would be quite easy to implement but requires updating every main.test.bicep template. Steps to implement:

  1. update ./settings.yml, add tags environment variable

Update Deployment validation section location: 'centralus' tags: '@{"Environment"="Lab";"Expiry Date"="12/31/2023";"Business Unit"="Cloud";"Owner"="Joe Thompson"}'

  1. update settings.yml under .github/actions/templates/valida

Agreed. Will tag it with the corresponding milestone. Thanks