Conversation
|
add to S168 |
|
@shenglol Why doesn't |
|
I suggest that it might be better to change the PR title, like: |
Currently the What-If back-end doesn't support mg-level and tenant-level deployments. We might add the support in the future. |
Thanks. I changed the title. |
|
@zhoxing-ms @jiasli do you mind helping merge it once the build pipeline passes? It would be great if we can still catch the next release. |
Absolutely! |
|
@Juliehzl could you take another look at the PR when you get a chance? Thanks! |
LGTM in general but curious about the fantastic function you add. 😊 |
|
|
||
| import unittest | ||
|
|
||
| from azure.mgmt.resource.resources.models import ( |
There was a problem hiding this comment.
We also need to use get_model() here.
Can you use mock() to test as shown here https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_webapp_commands_thru_mock.py#L85?
There was a problem hiding this comment.
Replaced import with get_model(). Regarding using mock(), I don't think it's needed in the formatters unit tests (since there's no dependencies to assert/verify), but I added two tests with mocks to verify prompt logic with -confirm-with-what-if, which seems to be worth testing to me: https://github.com/Azure/azure-cli/pull/12942/files#diff-a94496ee0aa9c24d38ce3e3e2793c8a2R337-R358.
Description of PR (Mandatory)
The PR adds new commands for ARM template deployment What-If (in preview):
az deployment sub what-ifaz deployment group what-ifwhich can tell users what will happen when they deploy a template if it is valid.
A new flag
--confirm-with-what-ifwas also added to the existingdeployment sub/group createcommands to allow users to review and acknowledge resource changes and execute deployment with one operation.Here's a sample output:

Testing Guide
(Example commands with explanations)
History Notes:
(Fill in the following template if multiple notes are needed, otherwise PR title will be used for history note.)
[ARM] Add template deployment What-If commands
This 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.