-
Notifications
You must be signed in to change notification settings - Fork 527
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
ManagementGroup: Run WhatIf test on e2e after deployment #250
Conversation
Thanks @olljanat for this work. As mentioned yesterday (in another discussion IIRC) we are not merging any other changes until #227 is complete and merged as this is a big PR and we need to close it out first before we keep making more merge conflicts we need to resolve. Can I propose we put this on hold until #227 is merged (hopefully next week) and then you can update this PR with the latest from the Let me know if all okay with that 👍 |
@jtracey93 that's fine. I added my self to #227 notification list and will rebase my PRs after it is merged. |
8ca6ad3
to
3e52b26
Compare
@jtracey93 rebased with main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you update the "all" parameters file with this new input please?
@jfaurskov can I also get your input here as I know you are re working the testing already.
/azp run ValidateAzCloud |
No pipelines are associated with this pull request. |
/azp run ValidateAzCloud |
Azure Pipelines failed to run 1 pipeline(s). |
/azp run ValidateAzCloud |
Azure Pipelines successfully started running 1 pipeline(s). |
3e52b26
to
3785296
Compare
@jtracey93 updated "all" parameters file and rebased with main. |
/azp run validateazcloud |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@olljanat a few more bits.
Also requesting @jfaurskov to review this PR too
infra-as-code/bicep/modules/managementGroups/managementGroups.bicep
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good to me. We should expand on this going forward as we split validation and deployment tests up into individual chunks.
Agreed and think these should be included on the deployment phase as needs to run again post deployment as a check that the what-if doesn't kick off saying there's a change, when there clearly wouldn't be 👍 |
infra-as-code/bicep/modules/managementGroups/managementGroups.bicep
Outdated
Show resolved
Hide resolved
infra-as-code/bicep/modules/managementGroups/managementGroups.bicep
Outdated
Show resolved
Hide resolved
d3cb169
to
d1e6a23
Compare
@jtracey93 looks that your idea to use |
Hey @olljanat I actually think having this as an input parameter is a nice idea as it enables some further use cases for nested ALZ deployments in some more complex scenarios 👍 |
d1e6a23
to
9743ede
Compare
@jtracey93 OK. Added it back but updated description because it is not really needed by WhatIf anymore (and not used in e2e because of that). |
/azp run validateazcloud |
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of changes to make it more robust for all users @olljanat (thanks for your patience)
@@ -69,6 +72,11 @@ resource resTopLevelMg 'Microsoft.Management/managementGroups@2021-04-01' = { | |||
name: parTopLevelManagementGroupPrefix | |||
properties: { | |||
displayName: parTopLevelManagementGroupDisplayName | |||
details: { | |||
parent: { | |||
id: parTopLevelManagementGroupParentId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the logic back here that if an empty string
is provided that we pass in /providers/Microsoft.Management/managementGroups/${tenant().tenantId}
?
If any other string is provided im happy for the error, like our test just picked up 😄
ERROR: {"status":"Failed","error":{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"BadRequest","message":"{\r\n \"error\": {\r\n \"code\": \"BadRequest\",\r\n \"message\": \"Invalid management group creation parameters: expected 'parentId' format: '/providers/Microsoft.Management/managementGroups/ID'\",\r\n \"details\": null\r\n }\r\n}"}]}}
If you can make the change, then we can get this one merged 👍
@@ -20,6 +20,7 @@ The module requires the following inputs: | |||
|
|||
| Parameter | Type | Description | Requirements | Example | | |||
| ------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- | --------------------- | | |||
| parTopLevelManagementGroupParentId | string | Optional Tenant Root Group ID. Used as top level management group parent. | | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add this to the example column for this please to help show what is expected: /providers/Microsoft.Management/managementGroups/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
Thanks 👍
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. |
Closing this as have wrapped into #276 |
Overview/Summary
Run WhatIf deployment for management group on e2e tests. Also added new optional parameter
parTopLevelManagementGroupParentId
which was needed for it.This PR fixes/adds/changes/removes
Breaking Changes
N/A
Testing Evidence
Without
parTopLevelManagementGroupParentId
parameter new WhatIf test step failed to error and it that it passed without issues.As part of this Pull Request I have
main
branch