Azure / AzOps

AzOps is a PowerShell module which deploys (Push) ARM Resource Templates & Bicep files at all Azure scope levels and exports (Pull) ARM resource hierarchy.
https://aka.ms/AzOps
MIT License
371 stars 158 forks source link

Adding Support for Parallel Deployments with Multiple Parameter Files #842

Closed Jefajers closed 6 months ago

Jefajers commented 6 months ago

Overview/Summary

This PR adds support for parallel deployments when used together with #836 resulting in deployments where applicable are processed in parallel and closes #832.

The below relationships between template file and parameters each represents a unique deployment (three in total) that is processed one by one in series.

This PR allows for this behaviour to be modified, so that the three deployments are processed in parallel. Thus, decreasing overall time spent waiting for WhatIf results and resource deployments.

scope/
├── template.x1.bicepparam
├── template.x2.bicepparam
├── template.x3.parameters.json
└── template.bicep

This behavior's is controlled with a new setting Core.ParallelDeployMultipleTemplateParameterFiles read more in the wiki or head over to faq.

This feature is disabled by default, to enable this feature set Core.ParallelDeployMultipleTemplateParameterFiles to true and review your Core.AllowMultipleTemplateParameterFiles setting, both needs to be true to enable this scenario.

How many deployments are processed in parallel? This is determined by the Core.ThrottleLimit value and is dependent on available compute cores.

This PR fixes/adds/changes/removes

  1. Changes tests.yml
  2. Changes Frequently-Asked-Questions.md
  3. Changes Settings.md
  4. Changes Initialize-AzOpsEnvironment.ps1
  5. Changes Invoke-AzOpsPush.ps1
  6. Changes Core.ps1
  7. Changes ConvertFrom-AzOpsBicepTemplate.ps1
  8. Changes New-AzOpsDeployment.ps1
  9. Changes Set-AzOpsContext.ps1
  10. Changes Set-AzOpsWhatIfOutput.ps1
  11. Changes Strings.psd1
  12. Changes Repository.Tests.ps1
  13. Changes azuredeploy.jsonc
  14. Adds staparalleldeploy.bicep
  15. Adds staparalleldeploy.xabcd.bicepparam
  16. Adds dstaparalleldeploy.xabcde.bicepparam
  17. Adds staparalleldeploy.xabcdf.bicepparam
  18. Adds staserialdeploy2.bicep
  19. Adds staserialdeploy2.xabcdfg.bicepparam

Testing Evidence

Several manual tests have been performed on logic and one automated test case added to pester.

As part of this Pull Request I have