Skip to content

feat: add ability to override varManagementGroupIds values in alzDefaultPolicyAssignments.bicep & workloadSpecificPolicyAssignments.bicep to support rename of ALZ default MGs and fix #986 #987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

jtracey93
Copy link
Collaborator

@jtracey93 jtracey93 commented Mar 25, 2025

Overview/Summary

Add ability to override varManagementGroupIds values in alzDefaultPolicyAssignments.bicep & workloadSpecificPolicyAssignments.bicep to support rename of ALZ default MGs

Useful for scenarios when renaming ALZ default management groups names and IDs but not their intent or hierarchy structure.

Also fix #986

Breaking Changes

None

Testing Evidence

Default logic, no inputs provided to new parameter
Screenshot 2025-03-25 125803

inputs provided to new parameter to override MG IDs
Screenshot 2025-03-25 125839

note the values for landingZonesCorp & landingZonesOnline

As part of this Pull Request I have

@jtracey93 jtracey93 had a problem deploying to BicepUpdateDocumentation March 25, 2025 13:10 — with GitHub Actions Failure
@jtracey93 jtracey93 had a problem deploying to BicepUpdateDocumentation March 25, 2025 13:11 — with GitHub Actions Failure
@jtracey93 jtracey93 marked this pull request as ready for review March 25, 2025 13:12
@jtracey93 jtracey93 requested review from Copilot and oZakari and removed request for Copilot March 25, 2025 13:12
@jtracey93 jtracey93 added Type: Feature Request ➕ New feature or request Type: Enhancement ✨ New feature or request labels Mar 25, 2025
Copy link

@Copilot 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

This PR adds the ability to override default management group IDs for ALZ policies, supporting scenarios where ALZ default management groups are renamed.

  • Added a new parameter (parManagementGroupIdOverrides) and updated the generated documentation in both alzDefaultPolicyAssignments.bicep.md and workloadSpecificPolicyAssignments.bicep.md.
  • Enhanced the parameter descriptions and snippets to include guidance on providing custom management group IDs.

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

File Description
infra-as-code/bicep/modules/policy/assignments/alzDefaults/generateddocs/alzDefaultPolicyAssignments.bicep.md Added documentation for the new override parameter
infra-as-code/bicep/modules/policy/assignments/workloadSpecificPolicyAssignments.bicep.md Added documentation for the new override parameter
Files not reviewed (2)
  • infra-as-code/bicep/modules/policy/assignments/alzDefaults/alzDefaultPolicyAssignments.bicep: Language not supported
  • infra-as-code/bicep/modules/policy/assignments/workloadSpecific/workloadSpecificPolicyAssignments.bicep: Language not supported
Comments suppressed due to low confidence (2)

infra-as-code/bicep/modules/policy/assignments/alzDefaults/generateddocs/alzDefaultPolicyAssignments.bicep.md:34

  • [nitpick] Consider renaming the parameter to use the plural form (e.g., parManagementGroupIdsOverrides) to better match the referenced variable (varManagementGroupIds) and update the description for clarity (e.g., include a possessive apostrophe in 'management groups' names').
parManagementGroupIdOverrides | Yes      | Specify the ALZ Default Management Group IDs to override as specified in `varManagementGroupIds`. Useful for scenarios when renaming ALZ default management groups names and IDs but not their intent or hierarchy structure.

infra-as-code/bicep/modules/policy/assignments/workloadSpecific/generateddocs/workloadSpecificPolicyAssignments.bicep.md:18

  • [nitpick] Consider renaming the parameter to use the plural form (e.g., parManagementGroupIdsOverrides) to align with the referenced variable (varManagementGroupIds) and consider updating the description to improve clarity by using the possessive form for 'management groups' names'.
parManagementGroupIdOverrides | Yes      | Specify the ALZ Default Management Group IDs to override as specified in `varManagementGroupIds`. Useful for scenarios when renaming ALZ default management groups names and IDs but not their intent or hierarchy structure.

@jtracey93 jtracey93 had a problem deploying to BicepUpdateDocumentation March 25, 2025 13:21 — with GitHub Actions Failure
@jtracey93 jtracey93 had a problem deploying to BicepUpdateDocumentation March 25, 2025 13:21 — with GitHub Actions Failure
@jtracey93 jtracey93 changed the title feat: add ability to override varManagementGroupIds values in alzDefaultPolicyAssignments.bicep & workloadSpecificPolicyAssignments.bicep to support rename of ALZ default MGs feat: add ability to override varManagementGroupIds values in alzDefaultPolicyAssignments.bicep & workloadSpecificPolicyAssignments.bicep to support rename of ALZ default MGs and fix #986 Mar 25, 2025
@jtracey93 jtracey93 had a problem deploying to BicepUpdateDocumentation March 25, 2025 13:21 — with GitHub Actions Failure
@jtracey93
Copy link
Collaborator Author

/azp run validateazcloud

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@oZakari oZakari temporarily deployed to BicepUpdateDocumentation March 25, 2025 21:24 — with GitHub Actions Inactive
oZakari
oZakari previously approved these changes Mar 26, 2025
Copy link
Contributor

@oZakari oZakari left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

Command 'validate' is not supported by Azure Pipelines.

Supported commands
  • help:
    • Get descriptions, examples and documentation about supported commands
    • Example: help "command_name"
  • list:
    • List all pipelines for this repository using a comment.
    • Example: "list"
  • run:
    • Run all pipelines or specific pipelines for this repository using a comment. Use this command by itself to trigger all related pipelines, or specify specific pipelines to run.
    • Example: "run" or "run pipeline_name, pipeline_name, pipeline_name"
  • where:
    • Report back the Azure DevOps orgs that are related to this repository and org
    • Example: "where"

See additional documentation.

@oZakari
Copy link
Contributor

oZakari commented Mar 26, 2025

/azp run validateazcloud

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 26, 2025 03:55 — with GitHub Actions Failure
@oZakari oZakari temporarily deployed to BicepUpdateDocumentation March 26, 2025 03:55 — with GitHub Actions Inactive
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 26, 2025 04:23 — with GitHub Actions Failure
@oZakari oZakari force-pushed the users/jtracey93/feat/update-parametrize-mg-ids-polciy-defaults branch from 2500c16 to 4876698 Compare March 26, 2025 04:23
@oZakari oZakari had a problem deploying to BicepUpdateDocumentation March 26, 2025 04:23 — with GitHub Actions Failure
@oZakari oZakari temporarily deployed to BicepUpdateDocumentation March 26, 2025 04:24 — with GitHub Actions Inactive
@oZakari
Copy link
Contributor

oZakari commented Mar 26, 2025

/azp run validateazcloud

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@oZakari oZakari force-pushed the users/jtracey93/feat/update-parametrize-mg-ids-polciy-defaults branch from e70330d to 1d0d1aa Compare March 26, 2025 04:41
@oZakari oZakari temporarily deployed to BicepUpdateDocumentation March 26, 2025 04:41 — with GitHub Actions Inactive
@oZakari
Copy link
Contributor

oZakari commented Mar 26, 2025

/azp run validateazcloud

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Azure Azure deleted a comment from azure-pipelines bot Mar 26, 2025
@oZakari oZakari merged commit 9aa0dd4 into main Mar 26, 2025
23 of 24 checks passed
@oZakari oZakari deleted the users/jtracey93/feat/update-parametrize-mg-ids-polciy-defaults branch March 26, 2025 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement ✨ New feature or request Type: Feature Request ➕ New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Daily Bicep Build & Lint Worklfow Failed
2 participants