forked from Azure/bicep-registry-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Enable tenant/constributor-specific parameters in test cases (A…
…zure#3015) ## Description - Example implementation to dynamically inject tenant/contributor-specific information into test cases - Tests - Using GitHub Secrets: Failed as not dynamic. All secrets would need to be declared explicitely in the templates, requiring continuous updates - Using Key Vault: Works, but requires an Azure Key Vault in the test subscription + granting the deploying principal Key Vault Secret User permissions on set Key vault - Secret values are fetched by prefix (currently `CI-`) and only if a given test template has a parameter of the same name. - Secrets are passed as secureStrings from beginning to end (i.e., also the parameter **must** be declared as `@secure()` - The test template parameter must follow the same naming as the secret to be matched as per the following rules - `CI-MySecret` would be matched wih a parameter named `mySecret` Remaining TODOs - [x] Agree on naming of variable & prefix - [x] Test whether the solution is robust enough to not fail if the Key Vault name variable is not set ([Test Run - See attempt Azure#1](https://github.com/Azure/bicep-registry-modules/actions/runs/10559737937)) <details><summary>Result</summary> The lack of the variable does **not** fail the pipeline as shown in the following run. The logic goes past the point where it checks for the Key Vault ![image](https://github.com/user-attachments/assets/8756cf62-bfef-473e-929f-01611ba560ee) </details> @clintgrove, @rahalan & @segraef, please note that if this PR is merged it means you would need to update your forks in order to continue contributing to your modules. As the names etc. can still change I'd advice against any action at this point, but you should be the first to know :) On the plus side, no more updating of tenant-specific values 😉 ### GitHub Settings ![image](https://github.com/user-attachments/assets/2af9a297-6938-4a29-b926-16e4148d949e) ### Azure KeyVault ![image](https://github.com/user-attachments/assets/24e57585-571e-4494-9aa7-de64feeb2d15) ### Pipeline logic in action ![image](https://github.com/user-attachments/assets/4efa1919-e09d-46af-ac4d-52cbfbbeef3e) ## Pipeline Reference <!-- Insert your Pipeline Status Badge below --> | Pipeline | | -------- | [![avm.res.managed-services.registration-definition](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.managed-services.registration-definition.yml/badge.svg?branch=users%2Falsehr%2FsecretPassThru&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.managed-services.registration-definition.yml) [![avm.res.compute.virtual-machine](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.yml/badge.svg?branch=users%2Falsehr%2FsecretPassThru&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.compute.virtual-machine.yml) [![avm.res.databricks.workspace](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.databricks.workspace.yml/badge.svg?branch=users%2Falsehr%2FsecretPassThru&event=workflow_dispatch)](https://github.com/Azure/bicep-registry-modules/actions/workflows/avm.res.databricks.workspace.yml) ## Type of Change <!-- Use the checkboxes [x] on the options that are relevant. --> - [ ] Update to CI Environment or utilities (Non-module affecting changes) - [ ] Azure Verified Module updates: - [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT bumped the MAJOR or MINOR version in `version.json`: - [ ] Someone has opened a bug report issue, and I have included "Closes #{bug_report_issue_number}" in the PR description. - [ ] The bug was found by the module author, and no one has opened an issue to report it yet. - [ ] Feature update backwards compatible feature updates, and I have bumped the MINOR version in `version.json`. - [ ] Breaking changes and I have bumped the MAJOR version in `version.json`. - [ ] Update to documentation ## Checklist - [ ] I'm sure there are no other open Pull Requests for the same update/change - [ ] I have run `Set-AVMModule` locally to generate the supporting module files. - [ ] My corresponding pipelines / checks run clean and green without any errors or warnings <!-- Please keep up to date with the contribution guide at https://aka.ms/avm/contribute/bicep --> --------- Co-authored-by: Jack Tracey <[email protected]>
- Loading branch information
1 parent
604beb8
commit d1a5a44
Showing
12 changed files
with
91 additions
and
17 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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