-
Notifications
You must be signed in to change notification settings - Fork 166
Extending AzOps Native Handling with Azure Deployment Stacks #923
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
Conversation
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.
Pull Request Overview
This PR extends AzOps native handling to support Azure Deployment Stack by adding new deployment stack settings functions, updating existing deployment, deletion, and push functions, and enhancing localized strings for deployment stack logging.
- Added new command Get-AzOpsDeploymentStackSetting with helper functions to resolve deployment stack configuration.
- Updated deployment and removal functions (e.g. New-AzOpsDeployment, Remove-AzOpsDeployment, Invoke-AzOpsPush) to support the new deployment stack process.
- Minor modifications across several internal functions (e.g. Get-AzOpsResource, role assignment functions) to enforce consistent parameter typing and incorporate deployment stack parameters.
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/localized/en-us/Strings.psd1 | Added new localized strings for handling deployment stack logs and errors. |
| src/internal/functions/Set-AzOpsWhatIfOutput.ps1 | Updated function signature and result headline generation to include an optional DeploymentStackTemplateFilePath. |
| src/internal/functions/Set-AzOpsRemoveOrder.ps1 | Adjusted deletion priority by incorporating deploymentStacks in the priority array when DeploymentStackSettings exists. |
| src/internal/functions/Remove-AzOpsDeployment.ps1 | Included additional parameters and conditions for deployment stack deletion scenarios. |
| src/internal/functions/New-AzOpsDeployment.ps1 | Updated deployment logic to choose appropriate deploymentStack cmdlets based on new settings. |
| src/internal/functions/Invoke-AzOpsRestMethod.ps1, Get-AzOpsRole*.ps1, Get-AzOpsPim.ps1 | Standardized parameter type casing. |
| src/internal/functions/Get-AzOpsResource.ps1 | Added DeploymentStackName parameter and logic to retrieve deployment stack resources. |
| src/internal/functions/Get-AzOpsDeploymentStackSetting.ps1 | New, complex function with helper routines for resolving deployment stack configuration and exclusions. |
| src/functions/Invoke-AzOpsPush.ps1 | Enhanced processing to handle deployment stack templates, including temporary file creation for parallel processing and deletion list path normalization. |
Overview/Summary
This PR adds capabilities in AzOps to handle Azure Deployment Stack natively and fixes #919.
This means that AzOps will attempt to perform
New-AzResourceGroupDeploymentStack,New-AzSubscriptionDeploymentStackorNew-AzManagementGroupDeploymentStackfor the custom template and parameter file in scope of the new AzOps deployment stack configuration settings file.Deletion is supported for the AzOps created DeploymentStack.
The setting files evaluated can have the following patterns:
.deploymentStacks.json,<templateName>.deploymentStacks.jsonor<templateName>.<templateMultiParameterName>.deploymentStacks.json.If multiple stacks are found they will be processed in the order of the most specific
<templateName>.<templateMultiParameterName>.deploymentStacks.jsonup to root level.deploymentStacks.jsonat the template scope. The first one matched and not excluded will be used.Example of folder and file structure where
.deploymentStack.jsonis used for most custom templates but not necessarily all:Example of the
deploymentStacks.jsonfile structure:{ "actionOnUnmanage": "deleteResources", "bypassStackOutOfSyncError": false, "denySettingsMode": "DenyDelete", "excludedAzOpsFiles": [ "dontLookAtMe.bicep" ] }This PR fixes/adds/changes/removes
Invoke-AzOpsPush.ps1Get-AzOpsDeploymentStackSetting.ps1Get-AzOpsResource.ps1New-AzOpsDeployment.ps1Remove-AzOpsDeployment.ps1Set-AzOpsRemoveOrder.ps1Set-AzOpsWhatIfOutput.ps1Strings.psd1DeploymentStacks.md_Sidebar.mdazuredeploy.jsoncdeploystacksatmg.bicepdeploystacksatmg.x1.bicepparamdeploystacksatmg.x1.deploymentStacks.jsondeploystacksatrg.bicepdeploystacksatrg.deploymentStacks.jsondeploystacksatsub.bicepdeploystacksatsub.bicepparamdeploystacksatsub.deploymentStacks.jsondeploystacksatsubrename.deploymentStacks.jsonBreaking Changes
Testing Evidence
PR contains three added automated test cases for DeploymentStacks.
As part of this Pull Request I have
mainbranch