Extending AzOps Native Handling with Azure Deployment Stacks#923
Merged
Jefajers merged 38 commits intoAzure:mainfrom May 20, 2025
Merged
Extending AzOps Native Handling with Azure Deployment Stacks#923Jefajers merged 38 commits intoAzure:mainfrom
Jefajers merged 38 commits intoAzure:mainfrom
Conversation
There was a problem hiding this comment.
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. |
daltondhcp
approved these changes
May 20, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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