-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Draft] Support --what-if argument
#32131
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: dev
Are you sure you want to change the base?
Conversation
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| network vnet create | cmd network vnet create added parameter export_bicep |
||
| network vnet create | cmd network vnet create added parameter what_if |
||
| network vnet update | cmd network vnet update added parameter export_bicep |
||
| network vnet update | cmd network vnet update added parameter what_if |
⚠️ storage
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| storage account create | cmd storage account create added parameter export_bicep |
||
| storage account create | cmd storage account create added parameter what_if |
||
| storage account network-rule add | cmd storage account network-rule add added parameter export_bicep |
||
| storage account network-rule add | cmd storage account network-rule add added parameter what_if |
||
| storage container create | cmd storage container create added parameter export_bicep |
||
| storage container create | cmd storage container create added parameter what_if |
||
| storage share create | cmd storage share create added parameter export_bicep |
||
| storage share create | cmd storage share create added parameter what_if |
⚠️ vm
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| vm create | cmd vm create added parameter export_bicep |
||
| vm create | cmd vm create added parameter what_if |
||
| vm disk attach | cmd vm disk attach added parameter export_bicep |
||
| vm disk attach | cmd vm disk attach added parameter what_if |
||
| vm disk detach | cmd vm disk detach added parameter export_bicep |
||
| vm disk detach | cmd vm disk detach added parameter what_if |
||
| vm nic remove | cmd vm nic remove added parameter export_bicep |
||
| vm nic remove | cmd vm nic remove added parameter what_if |
||
| vm update | cmd vm update added parameter export_bicep |
||
| vm update | cmd vm update added parameter what_if |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
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 adds support for the --what-if argument to Azure CLI commands, allowing users to preview changes before execution. The implementation includes a new what-if service client and parameter integration across VM and SQL command modules.
- Creates a new what-if module with Azure authentication and service communication
- Adds
--what-ifparameter support to VM and SQL command creation/update operations - Implements command interception logic to handle what-if mode execution
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli-core/azure/cli/core/what_if.py | New module implementing what-if service client with Azure authentication |
| src/azure-cli-core/azure/cli/core/commands/parameters.py | Adds get_what_if_type() function for parameter definition |
| src/azure-cli-core/azure/cli/core/commands/init.py | Implements command interception and what-if execution logic |
| src/azure-cli/azure/cli/command_modules/vm/_params.py | Adds what-if parameter to VM create and update commands |
| src/azure-cli/azure/cli/command_modules/vm/custom.py | Updates VM create function signature to accept what-if parameter |
| src/azure-cli/azure/cli/command_modules/sql/_params.py | Adds what-if parameter to SQL server create command |
| src/azure-cli/azure/cli/command_modules/sql/custom.py | Updates SQL server create function signature to accept what-if parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
20c2630 to
3f86e44
Compare
Related command
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.