-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Support -DryRun and -ExportBicep for Compute, Storage and Network specific commands #28833
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
base: main
Are you sure you want to change the base?
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
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 introduces a shared WhatIf formatting library for Azure PowerShell and integrates DryRun functionality across Compute, Storage, and Network modules. The shared library provides reusable formatters, models, and utilities for consistent WhatIf output formatting across different resource provider modules.
Key Changes
- Added a comprehensive shared WhatIf library with formatters, models, extensions, comparers, and utilities
- Integrated DryRun functionality in Compute, Storage, and Network modules with HTTP-based preview capabilities
- Added Bicep template export functionality for DryRun operations
Reviewed Changes
Copilot reviewed 39 out of 39 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared/WhatIf/Utilities/ResourceIdUtility.cs | New utility class for parsing Azure resource IDs |
| src/shared/WhatIf/Formatters/*.cs | Core formatting classes for colored console output |
| src/shared/WhatIf/Models/*.cs | Interface definitions and enums for WhatIf operations |
| src/shared/WhatIf/Extensions/*.cs | Extension methods for type conversions |
| src/shared/WhatIf/Comparers/*.cs | Comparer classes for sorting change types |
| src/shared/WhatIf/*.md | Documentation files (README, usage examples, integration guides) |
| src/Compute/Compute/Common/ComputeClientBaseCmdlet.cs | Added DryRun functionality with WhatIf adapter classes |
| src/Storage/Storage.Management/StorageAccount/StorageAccountBaseCmdlet.cs | Added DryRun functionality mirroring Compute implementation |
| src/Network/Network/VirtualNetwork/VirtualNetworkBaseCmdlet.cs | Added DryRun functionality mirroring Compute implementation |
| src/*/Compute.csproj, Storage.Management.csproj, Network.csproj | Added shared WhatIf library references |
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.
- considering there are active preview versions for storage and network, the base branch should be a combination of https://github.com/Azure/azure-powershell/tree/Az.Storage-preview and https://github.com/Azure/azure-powershell/tree/Az.Network-preview instead of main
| <PackageReference Include="System.Management" Version="4.5.0" /> | ||
| <!-- Include the following DLLs for security issue --> | ||
| <PackageReference Include="System.Security.Cryptography.Xml" Version="4.7.1" /> | ||
| <PackageReference Include="Azure.Identity" Version="1.11.4" /> |
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.
is this necessary? I thought azure identity will be brought in by az.accounts?
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.