-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Compute] BREAKING CHANGE: Fix #10728: az vm create
: create subnet automatically if vnet is specified and subnet not exists
#12115
Conversation
add to S165. |
@@ -677,7 +677,7 @@ def load_arguments(self, _): | |||
with self.argument_context(scope, arg_group='Network') as c: | |||
c.argument('vnet_name', help='Name of the virtual network when creating a new one or referencing an existing one.') | |||
c.argument('vnet_address_prefix', help='The IP address prefix to use when creating a new VNet in CIDR format.') | |||
c.argument('subnet', help='The name of the subnet when creating a new VNet or referencing an existing one. Can also reference an existing subnet by ID. If omitted, an appropriate VNet and subnet will be selected automatically, or a new one will be created.') | |||
c.argument('subnet', help='The name of the subnet when creating a new VNet or referencing an existing one. Can also reference an existing subnet by ID. If omitted, an appropriate VNet and subnet will be selected automatically only if VNet is also omitted, or a new one will be created if not exists.') |
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.
This doesn't seem very clear to me: If omitted, an appropriate VNet and subnet will be selected automatically only if VNet is also omitted, or a new one will be created if not exists.
My understanding is if subnet is ommited, we will use a default name. Then the process is the same as subnet not ommited?
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.
The logic of selecting automatically only happens when both vnet and subnet are omitted. And the auto create subnet logic happens when the subnet not exists, regardless where the value come from (user specified or generate from default format).
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.
Then A new one will be created if not exists.
should be in a separate sentence regardless of whether subnet is omitted.
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.
Actually a new one will be created
is already mentioned in the first sentence. So don't bother to change.
@@ -677,7 +677,7 @@ def load_arguments(self, _): | |||
with self.argument_context(scope, arg_group='Network') as c: | |||
c.argument('vnet_name', help='Name of the virtual network when creating a new one or referencing an existing one.') | |||
c.argument('vnet_address_prefix', help='The IP address prefix to use when creating a new VNet in CIDR format.') | |||
c.argument('subnet', help='The name of the subnet when creating a new VNet or referencing an existing one. Can also reference an existing subnet by ID. If omitted, an appropriate VNet and subnet will be selected automatically, or a new one will be created.') | |||
c.argument('subnet', help='The name of the subnet when creating a new VNet or referencing an existing one. Can also reference an existing subnet by ID. If omitted, an appropriate VNet and subnet will be selected automatically only if VNet is also omitted, or a new one will be created if not exists.') |
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.
The word "appropriate" is ambiguous in my mind.
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.
Hi @jiasli , could you please help give some suggestions to make this message clearer ?
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.
I don't know the behavior of this param. That's why I raised this question. 😆
We need to state the actual behavior based on the code logic.
subnet_obj = Subnet( | ||
name=subnet, | ||
address_prefixes=[subnet_address_prefix], | ||
address_prefix=subnet_address_prefix | ||
) |
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.
Adding a subnet is not as simple as adding a new resource. We need to take the vnet's address space and subnet's prefix into consideration.
It is very hard to deduce the new subnet's prefix based on the existing vnet's address space and existing subnet's prefix.
This PR will always try to add subnet 10.0.0.0/24
to the vnet. It'll succeed only if 10.0.0.0/24
is valid within the vnet, which is very unlikely in most cases. In other cases:
-
If the existing vnet
10.0.0.0/16
already has subnet10.0.0.0/24
, the creation will fail because the space is already occupied -
If the existing vnet is
10.3.0.0/16
, the creation will fail because the prefix is not in the allowed address space:Azure Error: NetcfgInvalidSubnet
Message: Subnet 'vm3Subnet' is not valid in virtual network 'vnet3'. -
If the existing vnet's address space is the same as the existing subnet's prefix - both
10.0.0.0/16
, the subnet creation will fail in any case, because there is no space left -
If the existing vnet's address space is
10.0.0.0/24
, how do we decide the mask of the subnet? 24, 25? It is not practical to do the decision for the user
My suggestion: If --vnet-name
and --subnet
are neither specified, az create
will detect if there is already a vnet and subnet in the resource group and put the vm there. We can apply the same when only --vnet-name
is specified with an existing vnet - if there is a subnet, put the vm there; if not, error out, instead of calculating the available prefix and creating a subnet voluntarily.
cc @myronfanqiu
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.
Yes, we discussed the cases you mentioned above before. Previously, there are some problems with the vnet/subnet prefix. However, for this PR, we don't want to change these behaviors, just keep them as before.
What we changed in this PR this that, when vnet is specified and exists, no matter subnet is specified or not, if the subnet not exists, create it without removing other existing subnets.
As the cases above, if the user not specify subnet prefix, it will use a default value (10.0.0.0/24) which may be wrong, however this is not the problem we want to solve in this PR.
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.
to share some context, not related with this PR. There's default vnet/subnet azure CLI created when creating VM. This is convenient scenario CLI providing: minimum effort to get started on a VM.
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.
Adding a subnet is not as simple as adding a new resource. We need to take the vnet's address space and subnet's prefix into consideration.
It is very hard to deduce the new subnet's prefix based on the existing vnet's address space and existing subnet's prefix.
This PR will always try to add subnet
10.0.0.0/24
to the vnet. It'll succeed only if10.0.0.0/24
is valid within the vnet, which is very unlikely in most cases. In other cases:1. If the existing vnet `10.0.0.0/16` already has subnet `10.0.0.0/24`, the creation will fail because the space is already occupied 2. If the existing vnet is `10.3.0.0/16`, the creation will fail because the prefix is not in the allowed address space: > Azure Error: NetcfgInvalidSubnet > Message: Subnet 'vm3Subnet' is not valid in virtual network 'vnet3'. 3. If the existing vnet's address space is the same as the existing subnet's prefix - both `10.0.0.0/16`, the subnet creation will fail in any case, because there is no space left 4. If the existing vnet's address space is `10.0.0.0/24`, how do we decide the mask of the subnet? 24, 25? It is not practical to do the decision for the user
My suggestion: If
--vnet-name
and--subnet
are neither specified,az create
will detect if there is already a vnet and subnet in the resource group and put the vm there. We can apply the same when only--vnet-name
is specified with an existing vnet - if there is a subnet, put the vm there; if not, error out, instead of calculating the available prefix and creating a subnet voluntarily.cc @myronfanqiu
1, retry 25, 26..., or 23, 22...
2, we can create subnet with same address of vnet
3. retry 25, 26..., or 23, 22...
4, Azure CLI always makes decision for users so that users can use a very simple command to create resources.
I agree it's complex and tricky. Users might be astonished when a strange subnet is created.
checks=self.is_empty()) | ||
|
||
self.cmd('network vnet create --resource-group {rg} --name {vnet} --location {loc}') | ||
self.cmd('vm create --resource-group {rg} --location {loc} --name {vm} --admin-username ubuntu --image UbuntuLTS --admin-password testPassword0 --authentication-type password --vnet-name {vnet}') |
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.
The test didn't fail because the vnet doesn't have subnets. Assume we create a vnet with this command:
az network vnet create -g {} -n vnet5 --location eastasia --address-prefix 10.0.0.0/16 --subnet-name sub1 --subnet-prefix 10.0.0.0/24
Then the vm create
will fail:
vm create --resource-group {} --location southeastasia --name {} --admin-username ubuntu --image UbuntuLTS --admin-password testPassword0 --authentication-type password --vnet-name vnet5
Azure Error: NetcfgInvalidSubnet
Message: Subnet '{}Subnet' is not valid in virtual network 'vnet5'.
Because 10.0.0.0/24
is already occupied by sub1
.
@@ -677,7 +677,7 @@ def load_arguments(self, _): | |||
with self.argument_context(scope, arg_group='Network') as c: | |||
c.argument('vnet_name', help='Name of the virtual network when creating a new one or referencing an existing one.') | |||
c.argument('vnet_address_prefix', help='The IP address prefix to use when creating a new VNet in CIDR format.') | |||
c.argument('subnet', help='The name of the subnet when creating a new VNet or referencing an existing one. Can also reference an existing subnet by ID. If omitted, an appropriate VNet and subnet will be selected automatically, or a new one will be created.') | |||
c.argument('subnet', help='The name of the subnet when creating a new VNet or referencing an existing one. Can also reference an existing subnet by ID. If omitted, an appropriate VNet and subnet will be selected automatically only if VNet is also omitted, or a new one will be created if not exists.') |
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.
Actually a new one will be created
is already mentioned in the first sentence. So don't bother to change.
try: | ||
cached_put(cmd, client.create_or_update, vnet, resource_group_name, vnet_name) | ||
except Exception: | ||
raise CLIError('Subnet({}) does not exist, fail to create new subnet with address prefix {}. ' |
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.
raise CLIError('Subnet({}) does not exist, fail to create new subnet with address prefix {}. ' | |
raise CLIError('Subnet({}) does not exist, but failed to create a new subnet with address prefix {}. ' |
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.
Thanks, updated.
except Exception: | ||
raise CLIError('Subnet({}) does not exist, fail to create new subnet with address prefix {}. ' | ||
'It may be caused by name or address prefix conflict. Please specify an ' | ||
'appropriate subnet name with --subnet or an valid address prefix value with ' |
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.
'appropriate subnet name with --subnet or an valid address prefix value with ' | |
'appropriate subnet name with --subnet or a valid address prefix value with ' |
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.
Thanks, updated.
So the problem is how can we create a valid subnet in a vnet. If there is no subnet in this vnet, I think we can create one for user. But if there are some existing subnets in this vnet, then it becomes harder. |
How do we know the user wants to use an existing subnet in the vnet or create a new subnet? |
…vnet is specified and subnet not exists
try to find the specified one first, if not exists, then will try to create a new one. In this case, user should also specify the subnet value, we update the help message to let user this. |
The commit history has problem. So many unrelated commit. And involve so many reviewers. You need to git reset and make the commit history correct. I guess the reason is that you checkout a new branch in your new machine and then you pull from this PR. |
Subnet = cmd.get_models('Subnet', resource_type=ResourceType.MGMT_NETWORK) | ||
subnet_obj = Subnet( | ||
name=subnet, | ||
address_prefixes=[subnet_address_prefix], |
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.
default value: subnet_address_prefix='10.0.0.0/24'
It may be incompatible with vnet. You can deduce a valid value from vnet.
I request a change here.
az vm create
: create subnet automatically if vnet is specified and subnet not existsaz vm create
: create subnet automatically if vnet is specified and subnet not exists
* {Misc.} Update CODEOWNERS (Azure#12149) * {Packaging} Update version management policy (Azure#12095) * [AppConfig]Add customer managed key when updating stores. (Azure#12102) * {Network} Connection Monitor V2 feature (Azure#12140) * [Compute] BREAKING CHANGE: Fix Azure#10728: `az vm create`: create subnet automatically if vnet is specified and subnet not exists (Azure#12115) * [Compute] Fix Azure#10728: `az vm create`: create subnet automatically if vnet is specified and subnet not exists * {Compute} update test_vm_commands to fix merge conflict * {Compute} fix test recording file for profile hybrid_2018_03_01 & hybrid_2019_03_01 * {Compute} update subnet help message & fail to create error message * {Compute} update fail to create subnet error message * {Compute} update test recording due to merge conflict * [Aladdin] Parse generated examples into commands' _help.py (Azure#11716) * [Compute] Increase robustness of vm image list (Azure#12134) * {KeyVault} Modify command group name `private-endpoint` to `private-endpoint-connection` (Azure#12151) * {Compute} Add missing parameter to attach disk example command (Azure#12045) attaching unmanaged disk without --name will cause error fix the example by adding `--name MyDataDisk` * [AppService] Add support for v3 function apps and node 12. (Azure#11987) * [functionapp] Add support for v3 function apps and node 12. * Changed --version to --functions-version to help clarify version flags. Added functions version to invalid runtime version error. * Fixed styling. * [AppService] az webapp list-runtimes: Fix the bug for list-runtimes (Azure#12172) * fix positional argument * add test for test_webapp_runtimes * {Packaging} Get rid of psutil dependency (Azure#11665) * {Release} Auto generate history notes (Azure#12098) * [AppService] az webapp|functionapp config ssl create: Add new commands to support create certificate (Azure#11955) * Support for Managed Certificate * Adding slot support * Added unit test * History change * Remove history - part of PR description now * Block calls for Free and Shared tier * Update unit test * Rename command to create * Fix to error text * {Packaging} Remove Python 2 in setup and doc (Azure#12155) * {Core} use caseless matching for provisioning_state (Azure#12154) * Fix az group deployment create has an error when using large parameters.json file (Azure#12047) * [ACR] `az acr login`: Throw a CLIError if there are errors returned by docker command (Azure#12156) * [Backup] Fix for item level recovery flow in OLR (Azure#12118) * Fix for item level recovery flow in OLR * style fix * [Backup] az backup recoveryconfig show: Add more parameters to support restoring as files for SQL/SAP Hana (Azure#12116) * initial commit * updated tests * updated history.rst * cli style fix * {Release} Upgrade to Azure CLI 2.1.0 (Azure#12195) * update azure-cli version to 2.1.0 * Update HISTORY.rst * {Package} remove requirements.py of python2 * Update commands.py Co-authored-by: Xiaojian Xu <[email protected]> * [ARM] az resource: Improve the examples of the resource module (Azure#11981) * {CI} Remove files related to Travis only (Azure#12203) * {Monitor} az monitor autoscale create: add example for custom rule based on guest os. (Azure#12205) * {azdev} Remove urllib3==1.24.2 from requirements.txt (Azure#12211) * [AKS] fix the aks browse in cloud shell. (Azure#12174) * {Storage} az storage share-rm: Add process_resource_group for resource group (Azure#12232) * add validator=process_resource_group * refine storage account validator * add more validate * [AKS] az aks: Fix monitoring addon and agentpool NoneType errors. (Azure#12250) * {SignalR} Fix show command fails with unexpected error when the resource doesn't exist (Azure#12266) * Do not copy tests dirs in docker image (Azure#12208) * [Storage] az storage blob delete-batch: Misbehaving `--dryrun` flag (Azure#12162) * [Storage] az storage blob delete-batch: Misbehaving `--dryrun` flag * [Storage] az storage blob delete-batch: Misbehaving `--dryrun` flag * [ACR] Fix: `az acr login` wrongly raise error (Azure#12282) * [Network] az network application-gateway rewrite-rule create: support url configuration (Azure#12277) * [Network] az network dns zone import: --zone-name will be case insensitive in the future. (Azure#12264) * fix (Azure#12300) * [AppService] Fix Azure#2258: Fixing issue where trying to create a webapp with certain runtimes was failing (Azure#12260) * Fixing issue where trying to create a webapp with certain runtimes was failing updating history Upating to make sure NODE works as well when trying to set app_Settings Pylint fixes * Adding test & re-recording * Removing the formatting changes to keep the changes to just the bug fix * {Network} Supplemnt help message of --source-address-prefixes and --destination-address-prefixes for nsg rule creation (Azure#12321) * {doc} Add Import Directive from docutils.parsers.rst for old API deprecation (Azure#12295) sphinx.util.compat is deprecated since 1.6 and removed in 1.7. * {Document} update install troubleshooting (Azure#12230) * {Network} Fix wrong import ZoneType of DNS (Azure#12322) * update codeowners (Azure#12201) * {Storage} Change api version range for storage account kind (Azure#12265) * change min_api * change test * [CosmosDB] Add Sql stored procedure, udf and trigger cmdlets (Azure#11999) * Added cosmosDB sql stored procedure, udf and trigger cmdlets * added help, fixed indentation, fixed wrong code * fixed a typo * indentation fix * flake8 issues fixed * PR comments * changed help accordingly * style fix * change in help msg * [ACS] (BREAKING CHANGE:) (az aks:) support msi changes for GF and BF for omsagent (Container monitoring)(#1) (Azure#12100) * [ARM] az policy assignment list: Support listing policy assignments at Management Group scope (Azure#12086) * Support listing policy assignments at MG scope * Fix test recording * Fix bug and add test case * {Packaging/Ubuntu} remove cosmic packaging (Azure#12330) * {Container monitoring} - Add case insensitive string compare for msi string (Azure#12341) * [KeyVault] keyvault create: enable soft-delete by default (Azure#12204) * make PE and PLS GA (Azure#12326) * [Network]az network bastion: support bastion (Azure#12331) * [AKS] az aks use-dev-spaces: Adding endpoint type option to use-dev-spaces command to customize the endpoint created on a controller (Azure#12028) * [AKS] add tag for nodepool (Azure#12145) * {Packaging/Homebrew} Remove patch when upgrade (Azure#12344) * {Find} az find: Remove EUII (Azure#12349) * delete azure-cli-extension (Azure#12362) * [Compute] sig image-version: add --data-snapshot-luns (Azure#12303) * [AppService] functionapp: Added error message to deployment command if resource group/function name invalid (Azure#12318) * [AppService] fixing flag cited in warning message (Azure#12364) * [ARM] Refactor deployment commands (Azure#10751) * update SDK version. * Refactor az deployment commands. * record tests. * test recordings. * [ACR] Add new command `az acr helm install-cli` (Azure#12336) * [Network] az network vnet list-available-ips: support list available ips in a vnet (Azure#12371) * Validate ip-address parameter + tests (Azure#12312) * [AppService] functionapp: Updated container image configuration for Linux apps (Azure#12317) * Updated linuxFxVersion configuration for linux apps. * Fixed HISTORY.rst, improved error message for invalid runtimes. * Changed how linuxFxVersion is handled for dotnet. Renamed constants for increased clarity. * [Network] Add new commands to manage flow-log and deprecate old configure command (Azure#12350) * {Packaging/windows pip} Use local python for az.bat (Azure#12323) * [Storage] az storage account network-rule add (bug fix): add operation should be idempotent (Azure#12327) * [Storage] az storage account network-rule add (bug fix): add operation should be idempotent * [Storage] az storage account network-rule add (bug fix): add operation should be idempotent * [Storage] az storage account network-rule add (bug fix): add operation should be idempotent * [Storage] az storage account network-rule add (bug fix): add operation should be idempotent * [AKS] Add support of creating private cluster (Azure#12353) * [SQL] Sql midb Add: list-deleted, show-deleted, update-retention, show-retention (Azure#12033) * Adding support for short term retention and deleted database for MI * Fixing help file * Fixing help file * Updating tests * Adressing comments * Fixing style errors * Fixing help files * Fixing help files * Resyncing required for tests * Chaning deletion-time to deleted-time * More details in description on retention_days * Adressing comments * {KeyVault} Fix the case sensitive issue while running commands without specifying resource group name (Azure#12405) * {Storage} az storage file copy start: add examples for snapshot Azure#12410 * {Documentation}Command guideline for private endpoint connection and private link resource (Azure#12403) * [AKS] add support for creation time node labels (Azure#12418) * move propagate_env_change.exe to storage account (Azure#12401) * {Telemetry} Disable telemetry for some clouds (Azure#12400) * [Storage] az storage account create/update: Add Routing Preference support (Azure#12309) * add routing preferences * add test * fix style and rerun test * add tests and refine code * Add test for false * {Monitor}show command should return 3 (Azure#12404) * {Find} Suppress old find extension (Azure#12432) * [Storage] Upgrade azure-mgmt-storage version to 8.0.0 (Azure#12437) * [ACR]: private link and CMK support (Azure#12381) * [AppService] Fix Azure#12251 app settings race condition during zip deploy (Azure#12262) * Acr: remove private .wheel file (Azure#12450) * [RDBMS] Support Private Endpoint Connections (Azure#12394) * [Compute] ppg show: add --colocation-status to Enable fetching the colocation status of all the resources in the proximity placement group (Azure#12248) * [Compute] vm/vmss/availability-set update: add --ppg to allowing updating ProximityPlacementGroup * stage * add test * Add help; Support translataion from name to ID * [Compute] ppg show: add --colocation to Enable fetching the colocation status of all the resources in the proximity placement group * Add test * update parameter name * test * revolve some comments * Update parameter * compute 11.0.0 * test * fix test * fix * {Compute} fix none check when list vmss extension. (Azure#11914) * [AKS] add missing / in the dashboard url. (Azure#12411) * add allowProtectedAppendWrite (Azure#12448) * [Monitor] az monitor metrics alert create: support `~` in `--condition`. (Azure#12439) * update codeowners (Azure#12453) * Improve the help of az policy assignment create (Azure#12343) * Fix the bug that automatically generated name of policy assignment exceeds the limit (Azure#12352) * [Cosmos DB] az cosmosdb create: add --key-uri to support adding key vault encryption information (Azure#12417) * adding key-value-key-uri to cosmos db * remove history note * update package in requirements * remove whitespace on blank line * remove whitespace from blank line * add preview flag and update test * re-running tests with new API version * rename new parameter * [ARM] az group deployment create: Add parameter `--aux-tenants` to support cross tenants (Azure#11765) (Azure#12221) * Add parameter --aux-tenants to support cross tenants for az group deployment create * Add cross tenant support to the refactored deployment group create * [ACR] add 'private-link-resource list' command (Azure#12454) * {Documentation}fix documenttation (Azure#12435) * [AKS] Support create aks clusters enabling managed identity (Azure#12420) * Support create aks clusters enabling managed identity * Remove 'preview' * Add test case for AKS using managed identity * [CDN] Add CDN WAF commands (Azure#12071) * [Core] az cloud show: add insights telemetry channel endpoint for China/US cloud (Azure#12442) * [Storage] Add support for private link resource (Azure#12383) * initialize privete link for storage * refine command with help * refine help * pass test_storage_account_private_link * add exception handler * add exception handler * pass test * fix style * change list-private-link-resource to private-link-resource list * fix style and linter * apply validator and transform in core * enabled id_part for private linke resource list * remove previous validator and transform in storage * fix style * pass test * add ids for private link resource list * resolve comments * remove --ids to make linter pass * [Compute] az vmss create/update: support automatic repairs (Azure#12374) * [Compute] az vmss create/update: support automatic repairs * {Compute} fix automatic repairs style error * {Compute} update help message for --automatic-repairs-grace-period * {Compute} update validator error message for automatic repairs * {Compute} add automatic repairs arg group in vmss update * {Compute} fix sytle error in _params.py * [AKS] Validate network plugin to be either "azure" or "kubenet". (Azure#12376) * [AppService] Fix #5720946: az webapp backup fails to set name (Azure#11929) * Fix backup name set functionality * Add test for backup * changes to meet checkstyles * add recording * [RBAC] az ad group show: fix --group value treated as regex problem (Azure#12426) * [RBAC] az ad group show: fix --group value treated as regex problem * {RBAC} update syntax error of error message * {RBAC} retrieve domain from az ad signed-in-user show instead of hard code * {RBAC} refactor validate_group function * {RBAC} update recording file for test_graph_group_idempotent * {RBAC} update test_graph * {RBAC} update test_graph to use the right user info Co-authored-by: Xiaojian Xu <[email protected]> * [Storage] Add PITR support (Azure#12372) * add action for blob range * add -t for time_to_restore * add restore_policy properties * rename restore_retention_days to restore_days * try to add test * add support_no_wait * refine test * fix style * enable no wait for restore * pass live test * fix comments and make blob range opetional * fix style * {KeyVault} Modify private link commands to align with storage (Azure#12457) * {Core} Change help example hook (Azure#12431) * [AKS] Add aad session key support. (Azure#12290) * {Release} use pat for github requests (Azure#12474) * {Packaging} bump up pyyaml (Azure#12440) * [RDBMS] Updating RDBMS Private Endpoint Tests (Azure#12475) * [Compute] image builder create: add --image-template\n[Compute] [BREAKING CHANGE] image template: rename template to builder (Azure#11865) * Add test for latest profile * [Compute] image template create: add --customize and --distribute * Add history * Fix style * Update test * rename template to builder * update help * add image_template * --image-template * test * remove --customize and --distribute * try-catch json error * help * fix style * fix a bug; update help * test of local file * Add example * error handle * help * [SQL] az sql server create/update: Add --enable-public-network to support PublicNetworkAccess (Azure#12382) * Add PublicNetworkAccess to Create and Update Server * Fix some styling + rerecorded tests * Fix more CLI style * Cleaned up code according to comments * Change public-network-access to enable-public-network * Bump up azure-mgmt-sql version * Rerecorded a couple of failing tests * Rerecord a couple more tests * Forgot to update test_sql_commands * Rerecord another test * Updating more tests * Small changes + more rerecorded tests * Fix style check errors * Random small change to rerun tests * Replace API versions * Fix style * [SQL DB, SQL MI] Add minimal_tls_version property for MI and SQL DB (Azure#12414) * Managed Instance commands updated with new property * Added enum defs for input parameter and updated Sql Server arg * fix blank line style error * Add minimal_tls_version for sql db server * adding tests * Adding recordings for tests * Re-record mi db test * Bump dependency version on azure-mgmt-sql, fix lint errors * Fix code style/lint errors * re-recorded tests * record tets * reset some of the test fixes and added recordings * reset some of the test fixes and added recordings * retry * style Co-authored-by: ziwa-msft <[email protected]> * [AppConfig] Unblock using appconfig kv set to add keyvault reference and feature flag (Azure#12377) * {Release} Upgrade to Azure CLI 2.2.0 (Azure#12486) * {Document} Fix dead documentation link to Microsoft open source page (Azure#12481) * {Compute} Delay vm image accept-terms expiration (Azure#12487) * {Packaging} Use python3 abspath in az script. (Azure#12467) * add test and fix 12387 (Azure#12518) * {CDN} Delay importing ErrorResponseException (Azure#12535) Co-authored-by: Feng Zhou <[email protected]> Co-authored-by: Shuai Wang <[email protected]> Co-authored-by: Jianhui Harold <[email protected]> Co-authored-by: Xiaojian Xu <[email protected]> Co-authored-by: Feiyue Yu <[email protected]> Co-authored-by: Bin Ma <[email protected]> Co-authored-by: Gao Ruifeng <[email protected]> Co-authored-by: Graham Zuber <[email protected]> Co-authored-by: Zunli Hu <[email protected]> Co-authored-by: Viacheslav Vasilyev <[email protected]> Co-authored-by: Mads Damgård <[email protected]> Co-authored-by: Xing Zhou <[email protected]> Co-authored-by: Lixia (Sylvia) Lei <[email protected]> Co-authored-by: Sambit Rath <[email protected]> Co-authored-by: Azure CLI Bot <[email protected]> Co-authored-by: MyronFanQiu <[email protected]> Co-authored-by: Jiashuo Li <[email protected]> Co-authored-by: Liming Liu <[email protected]> Co-authored-by: Jun Sun <[email protected]> Co-authored-by: stan-sz <[email protected]> Co-authored-by: Sylvain Rabot <[email protected]> Co-authored-by: qianwens <[email protected]> Co-authored-by: Sisira Panchagnula <[email protected]> Co-authored-by: Luca Boccassi <[email protected]> Co-authored-by: Yunge Zhu <[email protected]> Co-authored-by: Meha Kaushik <[email protected]> Co-authored-by: rashmichandrashekar <[email protected]> Co-authored-by: Chris Eggert <[email protected]> Co-authored-by: rakeshvanga <[email protected]> Co-authored-by: Qingqing <[email protected]> Co-authored-by: Matthew Booe <[email protected]> Co-authored-by: Brandon H <[email protected]> Co-authored-by: Tiano2017 <[email protected]> Co-authored-by: Pengfei Ni <[email protected]> Co-authored-by: djnisic <[email protected]> Co-authored-by: Xiaofang Zhang <[email protected]> Co-authored-by: Yugang Wang <[email protected]> Co-authored-by: yonzhan <[email protected]> Co-authored-by: Xiaojian Xu <[email protected]> Co-authored-by: Ramkumar Chandrasekaran <[email protected]> Co-authored-by: emgu-ms <[email protected]> Co-authored-by: Andrija Cicovic <[email protected]> Co-authored-by: ziwa-msft <[email protected]> Co-authored-by: Jacob Bundgaard <[email protected]> Co-authored-by: Matthew Ryan <[email protected]> Co-authored-by: Audunn Baldvinsson <[email protected]>
…data protection volumes and added replication operations (#12173) * ANF-448 additions for 2019-10-01 API * ANF-448 additions for 2019-10-01 API * update azure-mgmt-network to correct value * Fix versions * linter and style fixes * Updated list mount targest recording * updated test recordings * recodings python update * [netappfiles] Anf 448 cli for 2019 10 01 sync upstream (#6) * {Misc.} Update CODEOWNERS (#12149) * {Packaging} Update version management policy (#12095) * [AppConfig]Add customer managed key when updating stores. (#12102) * {Network} Connection Monitor V2 feature (#12140) * [Compute] BREAKING CHANGE: Fix #10728: `az vm create`: create subnet automatically if vnet is specified and subnet not exists (#12115) * [Compute] Fix #10728: `az vm create`: create subnet automatically if vnet is specified and subnet not exists * {Compute} update test_vm_commands to fix merge conflict * {Compute} fix test recording file for profile hybrid_2018_03_01 & hybrid_2019_03_01 * {Compute} update subnet help message & fail to create error message * {Compute} update fail to create subnet error message * {Compute} update test recording due to merge conflict * [Aladdin] Parse generated examples into commands' _help.py (#11716) * [Compute] Increase robustness of vm image list (#12134) * {KeyVault} Modify command group name `private-endpoint` to `private-endpoint-connection` (#12151) * {Compute} Add missing parameter to attach disk example command (#12045) attaching unmanaged disk without --name will cause error fix the example by adding `--name MyDataDisk` * [AppService] Add support for v3 function apps and node 12. (#11987) * [functionapp] Add support for v3 function apps and node 12. * Changed --version to --functions-version to help clarify version flags. Added functions version to invalid runtime version error. * Fixed styling. * [AppService] az webapp list-runtimes: Fix the bug for list-runtimes (#12172) * fix positional argument * add test for test_webapp_runtimes * {Packaging} Get rid of psutil dependency (#11665) * {Release} Auto generate history notes (#12098) * [AppService] az webapp|functionapp config ssl create: Add new commands to support create certificate (#11955) * Support for Managed Certificate * Adding slot support * Added unit test * History change * Remove history - part of PR description now * Block calls for Free and Shared tier * Update unit test * Rename command to create * Fix to error text * {Packaging} Remove Python 2 in setup and doc (#12155) * {Core} use caseless matching for provisioning_state (#12154) * Fix az group deployment create has an error when using large parameters.json file (#12047) * [ACR] `az acr login`: Throw a CLIError if there are errors returned by docker command (#12156) * [Backup] Fix for item level recovery flow in OLR (#12118) * Fix for item level recovery flow in OLR * style fix * [Backup] az backup recoveryconfig show: Add more parameters to support restoring as files for SQL/SAP Hana (#12116) * initial commit * updated tests * updated history.rst * cli style fix * {Release} Upgrade to Azure CLI 2.1.0 (#12195) * update azure-cli version to 2.1.0 * Update HISTORY.rst * {Package} remove requirements.py of python2 * Update commands.py Co-authored-by: Xiaojian Xu <[email protected]> * [ARM] az resource: Improve the examples of the resource module (#11981) * {CI} Remove files related to Travis only (#12203) * {Monitor} az monitor autoscale create: add example for custom rule based on guest os. (#12205) * {azdev} Remove urllib3==1.24.2 from requirements.txt (#12211) * [AKS] fix the aks browse in cloud shell. (#12174) * {Storage} az storage share-rm: Add process_resource_group for resource group (#12232) * add validator=process_resource_group * refine storage account validator * add more validate * [AKS] az aks: Fix monitoring addon and agentpool NoneType errors. (#12250) * {SignalR} Fix show command fails with unexpected error when the resource doesn't exist (#12266) * Do not copy tests dirs in docker image (#12208) * [Storage] az storage blob delete-batch: Misbehaving `--dryrun` flag (#12162) * [Storage] az storage blob delete-batch: Misbehaving `--dryrun` flag * [Storage] az storage blob delete-batch: Misbehaving `--dryrun` flag * [ACR] Fix: `az acr login` wrongly raise error (#12282) * [Network] az network application-gateway rewrite-rule create: support url configuration (#12277) * [Network] az network dns zone import: --zone-name will be case insensitive in the future. (#12264) * fix (#12300) * [AppService] Fix #2258: Fixing issue where trying to create a webapp with certain runtimes was failing (#12260) * Fixing issue where trying to create a webapp with certain runtimes was failing updating history Upating to make sure NODE works as well when trying to set app_Settings Pylint fixes * Adding test & re-recording * Removing the formatting changes to keep the changes to just the bug fix * {Network} Supplemnt help message of --source-address-prefixes and --destination-address-prefixes for nsg rule creation (#12321) * {doc} Add Import Directive from docutils.parsers.rst for old API deprecation (#12295) sphinx.util.compat is deprecated since 1.6 and removed in 1.7. * {Document} update install troubleshooting (#12230) * {Network} Fix wrong import ZoneType of DNS (#12322) * update codeowners (#12201) * {Storage} Change api version range for storage account kind (#12265) * change min_api * change test * [CosmosDB] Add Sql stored procedure, udf and trigger cmdlets (#11999) * Added cosmosDB sql stored procedure, udf and trigger cmdlets * added help, fixed indentation, fixed wrong code * fixed a typo * indentation fix * flake8 issues fixed * PR comments * changed help accordingly * style fix * change in help msg * [ACS] (BREAKING CHANGE:) (az aks:) support msi changes for GF and BF for omsagent (Container monitoring)(#1) (#12100) * [ARM] az policy assignment list: Support listing policy assignments at Management Group scope (#12086) * Support listing policy assignments at MG scope * Fix test recording * Fix bug and add test case * {Packaging/Ubuntu} remove cosmic packaging (#12330) * {Container monitoring} - Add case insensitive string compare for msi string (#12341) * [KeyVault] keyvault create: enable soft-delete by default (#12204) * make PE and PLS GA (#12326) * [Network]az network bastion: support bastion (#12331) * [AKS] az aks use-dev-spaces: Adding endpoint type option to use-dev-spaces command to customize the endpoint created on a controller (#12028) * [AKS] add tag for nodepool (#12145) * {Packaging/Homebrew} Remove patch when upgrade (#12344) * {Find} az find: Remove EUII (#12349) * delete azure-cli-extension (#12362) * [Compute] sig image-version: add --data-snapshot-luns (#12303) * [AppService] functionapp: Added error message to deployment command if resource group/function name invalid (#12318) * [AppService] fixing flag cited in warning message (#12364) * [ARM] Refactor deployment commands (#10751) * update SDK version. * Refactor az deployment commands. * record tests. * test recordings. * [ACR] Add new command `az acr helm install-cli` (#12336) * [Network] az network vnet list-available-ips: support list available ips in a vnet (#12371) * Validate ip-address parameter + tests (#12312) * [AppService] functionapp: Updated container image configuration for Linux apps (#12317) * Updated linuxFxVersion configuration for linux apps. * Fixed HISTORY.rst, improved error message for invalid runtimes. * Changed how linuxFxVersion is handled for dotnet. Renamed constants for increased clarity. * [Network] Add new commands to manage flow-log and deprecate old configure command (#12350) * {Packaging/windows pip} Use local python for az.bat (#12323) * [Storage] az storage account network-rule add (bug fix): add operation should be idempotent (#12327) * [Storage] az storage account network-rule add (bug fix): add operation should be idempotent * [Storage] az storage account network-rule add (bug fix): add operation should be idempotent * [Storage] az storage account network-rule add (bug fix): add operation should be idempotent * [Storage] az storage account network-rule add (bug fix): add operation should be idempotent * [AKS] Add support of creating private cluster (#12353) * [SQL] Sql midb Add: list-deleted, show-deleted, update-retention, show-retention (#12033) * Adding support for short term retention and deleted database for MI * Fixing help file * Fixing help file * Updating tests * Adressing comments * Fixing style errors * Fixing help files * Fixing help files * Resyncing required for tests * Chaning deletion-time to deleted-time * More details in description on retention_days * Adressing comments * {KeyVault} Fix the case sensitive issue while running commands without specifying resource group name (#12405) * {Storage} az storage file copy start: add examples for snapshot #12410 * {Documentation}Command guideline for private endpoint connection and private link resource (#12403) * [AKS] add support for creation time node labels (#12418) * move propagate_env_change.exe to storage account (#12401) * {Telemetry} Disable telemetry for some clouds (#12400) * [Storage] az storage account create/update: Add Routing Preference support (#12309) * add routing preferences * add test * fix style and rerun test * add tests and refine code * Add test for false * {Monitor}show command should return 3 (#12404) * {Find} Suppress old find extension (#12432) * [Storage] Upgrade azure-mgmt-storage version to 8.0.0 (#12437) * [ACR]: private link and CMK support (#12381) * [AppService] Fix #12251 app settings race condition during zip deploy (#12262) * Acr: remove private .wheel file (#12450) * [RDBMS] Support Private Endpoint Connections (#12394) * [Compute] ppg show: add --colocation-status to Enable fetching the colocation status of all the resources in the proximity placement group (#12248) * [Compute] vm/vmss/availability-set update: add --ppg to allowing updating ProximityPlacementGroup * stage * add test * Add help; Support translataion from name to ID * [Compute] ppg show: add --colocation to Enable fetching the colocation status of all the resources in the proximity placement group * Add test * update parameter name * test * revolve some comments * Update parameter * compute 11.0.0 * test * fix test * fix * {Compute} fix none check when list vmss extension. (#11914) * [AKS] add missing / in the dashboard url. (#12411) * add allowProtectedAppendWrite (#12448) * [Monitor] az monitor metrics alert create: support `~` in `--condition`. (#12439) * update codeowners (#12453) * Improve the help of az policy assignment create (#12343) * Fix the bug that automatically generated name of policy assignment exceeds the limit (#12352) * [Cosmos DB] az cosmosdb create: add --key-uri to support adding key vault encryption information (#12417) * adding key-value-key-uri to cosmos db * remove history note * update package in requirements * remove whitespace on blank line * remove whitespace from blank line * add preview flag and update test * re-running tests with new API version * rename new parameter * [ARM] az group deployment create: Add parameter `--aux-tenants` to support cross tenants (#11765) (#12221) * Add parameter --aux-tenants to support cross tenants for az group deployment create * Add cross tenant support to the refactored deployment group create * [ACR] add 'private-link-resource list' command (#12454) * {Documentation}fix documenttation (#12435) * [AKS] Support create aks clusters enabling managed identity (#12420) * Support create aks clusters enabling managed identity * Remove 'preview' * Add test case for AKS using managed identity * [CDN] Add CDN WAF commands (#12071) * [Core] az cloud show: add insights telemetry channel endpoint for China/US cloud (#12442) * [Storage] Add support for private link resource (#12383) * initialize privete link for storage * refine command with help * refine help * pass test_storage_account_private_link * add exception handler * add exception handler * pass test * fix style * change list-private-link-resource to private-link-resource list * fix style and linter * apply validator and transform in core * enabled id_part for private linke resource list * remove previous validator and transform in storage * fix style * pass test * add ids for private link resource list * resolve comments * remove --ids to make linter pass * [Compute] az vmss create/update: support automatic repairs (#12374) * [Compute] az vmss create/update: support automatic repairs * {Compute} fix automatic repairs style error * {Compute} update help message for --automatic-repairs-grace-period * {Compute} update validator error message for automatic repairs * {Compute} add automatic repairs arg group in vmss update * {Compute} fix sytle error in _params.py * [AKS] Validate network plugin to be either "azure" or "kubenet". (#12376) * [AppService] Fix #5720946: az webapp backup fails to set name (#11929) * Fix backup name set functionality * Add test for backup * changes to meet checkstyles * add recording * [RBAC] az ad group show: fix --group value treated as regex problem (#12426) * [RBAC] az ad group show: fix --group value treated as regex problem * {RBAC} update syntax error of error message * {RBAC} retrieve domain from az ad signed-in-user show instead of hard code * {RBAC} refactor validate_group function * {RBAC} update recording file for test_graph_group_idempotent * {RBAC} update test_graph * {RBAC} update test_graph to use the right user info Co-authored-by: Xiaojian Xu <[email protected]> * [Storage] Add PITR support (#12372) * add action for blob range * add -t for time_to_restore * add restore_policy properties * rename restore_retention_days to restore_days * try to add test * add support_no_wait * refine test * fix style * enable no wait for restore * pass live test * fix comments and make blob range opetional * fix style * {KeyVault} Modify private link commands to align with storage (#12457) * {Core} Change help example hook (#12431) * [AKS] Add aad session key support. (#12290) * {Release} use pat for github requests (#12474) * {Packaging} bump up pyyaml (#12440) * [RDBMS] Updating RDBMS Private Endpoint Tests (#12475) * [Compute] image builder create: add --image-template\n[Compute] [BREAKING CHANGE] image template: rename template to builder (#11865) * Add test for latest profile * [Compute] image template create: add --customize and --distribute * Add history * Fix style * Update test * rename template to builder * update help * add image_template * --image-template * test * remove --customize and --distribute * try-catch json error * help * fix style * fix a bug; update help * test of local file * Add example * error handle * help * [SQL] az sql server create/update: Add --enable-public-network to support PublicNetworkAccess (#12382) * Add PublicNetworkAccess to Create and Update Server * Fix some styling + rerecorded tests * Fix more CLI style * Cleaned up code according to comments * Change public-network-access to enable-public-network * Bump up azure-mgmt-sql version * Rerecorded a couple of failing tests * Rerecord a couple more tests * Forgot to update test_sql_commands * Rerecord another test * Updating more tests * Small changes + more rerecorded tests * Fix style check errors * Random small change to rerun tests * Replace API versions * Fix style * [SQL DB, SQL MI] Add minimal_tls_version property for MI and SQL DB (#12414) * Managed Instance commands updated with new property * Added enum defs for input parameter and updated Sql Server arg * fix blank line style error * Add minimal_tls_version for sql db server * adding tests * Adding recordings for tests * Re-record mi db test * Bump dependency version on azure-mgmt-sql, fix lint errors * Fix code style/lint errors * re-recorded tests * record tets * reset some of the test fixes and added recordings * reset some of the test fixes and added recordings * retry * style Co-authored-by: ziwa-msft <[email protected]> * [AppConfig] Unblock using appconfig kv set to add keyvault reference and feature flag (#12377) * {Release} Upgrade to Azure CLI 2.2.0 (#12486) * {Document} Fix dead documentation link to Microsoft open source page (#12481) * {Compute} Delay vm image accept-terms expiration (#12487) * {Packaging} Use python3 abspath in az script. (#12467) * add test and fix 12387 (#12518) * {CDN} Delay importing ErrorResponseException (#12535) Co-authored-by: Feng Zhou <[email protected]> Co-authored-by: Shuai Wang <[email protected]> Co-authored-by: Jianhui Harold <[email protected]> Co-authored-by: Xiaojian Xu <[email protected]> Co-authored-by: Feiyue Yu <[email protected]> Co-authored-by: Bin Ma <[email protected]> Co-authored-by: Gao Ruifeng <[email protected]> Co-authored-by: Graham Zuber <[email protected]> Co-authored-by: Zunli Hu <[email protected]> Co-authored-by: Viacheslav Vasilyev <[email protected]> Co-authored-by: Mads Damgård <[email protected]> Co-authored-by: Xing Zhou <[email protected]> Co-authored-by: Lixia (Sylvia) Lei <[email protected]> Co-authored-by: Sambit Rath <[email protected]> Co-authored-by: Azure CLI Bot <[email protected]> Co-authored-by: MyronFanQiu <[email protected]> Co-authored-by: Jiashuo Li <[email protected]> Co-authored-by: Liming Liu <[email protected]> Co-authored-by: Jun Sun <[email protected]> Co-authored-by: stan-sz <[email protected]> Co-authored-by: Sylvain Rabot <[email protected]> Co-authored-by: qianwens <[email protected]> Co-authored-by: Sisira Panchagnula <[email protected]> Co-authored-by: Luca Boccassi <[email protected]> Co-authored-by: Yunge Zhu <[email protected]> Co-authored-by: Meha Kaushik <[email protected]> Co-authored-by: rashmichandrashekar <[email protected]> Co-authored-by: Chris Eggert <[email protected]> Co-authored-by: rakeshvanga <[email protected]> Co-authored-by: Qingqing <[email protected]> Co-authored-by: Matthew Booe <[email protected]> Co-authored-by: Brandon H <[email protected]> Co-authored-by: Tiano2017 <[email protected]> Co-authored-by: Pengfei Ni <[email protected]> Co-authored-by: djnisic <[email protected]> Co-authored-by: Xiaofang Zhang <[email protected]> Co-authored-by: Yugang Wang <[email protected]> Co-authored-by: yonzhan <[email protected]> Co-authored-by: Xiaojian Xu <[email protected]> Co-authored-by: Ramkumar Chandrasekaran <[email protected]> Co-authored-by: emgu-ms <[email protected]> Co-authored-by: Andrija Cicovic <[email protected]> Co-authored-by: ziwa-msft <[email protected]> Co-authored-by: Jacob Bundgaard <[email protected]> Co-authored-by: Matthew Ryan <[email protected]> Co-authored-by: Audunn Baldvinsson <[email protected]> * Changing the Replication command pause to suspend. * Updated help texts Co-authored-by: leonard <[email protected]> Co-authored-by: Audunn Baldvinsson <[email protected]> Co-authored-by: Feng Zhou <[email protected]> Co-authored-by: Shuai Wang <[email protected]> Co-authored-by: Jianhui Harold <[email protected]> Co-authored-by: Xiaojian Xu <[email protected]> Co-authored-by: Feiyue Yu <[email protected]> Co-authored-by: Bin Ma <[email protected]> Co-authored-by: Gao Ruifeng <[email protected]> Co-authored-by: Graham Zuber <[email protected]> Co-authored-by: Zunli Hu <[email protected]> Co-authored-by: Viacheslav Vasilyev <[email protected]> Co-authored-by: Mads Damgård <[email protected]> Co-authored-by: Xing Zhou <[email protected]> Co-authored-by: Lixia (Sylvia) Lei <[email protected]> Co-authored-by: Sambit Rath <[email protected]> Co-authored-by: Azure CLI Bot <[email protected]> Co-authored-by: MyronFanQiu <[email protected]> Co-authored-by: Jiashuo Li <[email protected]> Co-authored-by: Liming Liu <[email protected]> Co-authored-by: Jun Sun <[email protected]> Co-authored-by: stan-sz <[email protected]> Co-authored-by: Sylvain Rabot <[email protected]> Co-authored-by: qianwens <[email protected]> Co-authored-by: Sisira Panchagnula <[email protected]> Co-authored-by: Luca Boccassi <[email protected]> Co-authored-by: Yunge Zhu <[email protected]> Co-authored-by: Meha Kaushik <[email protected]> Co-authored-by: rashmichandrashekar <[email protected]> Co-authored-by: Chris Eggert <[email protected]> Co-authored-by: rakeshvanga <[email protected]> Co-authored-by: Qingqing <[email protected]> Co-authored-by: Matthew Booe <[email protected]> Co-authored-by: Brandon H <[email protected]> Co-authored-by: Tiano2017 <[email protected]> Co-authored-by: Pengfei Ni <[email protected]> Co-authored-by: djnisic <[email protected]> Co-authored-by: Xiaofang Zhang <[email protected]> Co-authored-by: Yugang Wang <[email protected]> Co-authored-by: yonzhan <[email protected]> Co-authored-by: Xiaojian Xu <[email protected]> Co-authored-by: Ramkumar Chandrasekaran <[email protected]> Co-authored-by: emgu-ms <[email protected]> Co-authored-by: Andrija Cicovic <[email protected]> Co-authored-by: ziwa-msft <[email protected]> Co-authored-by: Jacob Bundgaard <[email protected]> Co-authored-by: Matthew Ryan <[email protected]>
This PR is to fix #10728
Previously, when user use below command:
az vm create -n MyRG --image Win2019Datacenter --size Standard_D2s_v3 --nsg sql-server --vnet-name MyRG-vnet
As subnet is not specified here, Azure CLI will generate a default value for it (the format is {VMName}Subnet, in this case, subnet value will be MyRGSubnet).
Azure CLI will try to create/update the vnet with this subnet. So if the vnet exists and already has subnets, the behavior here will be that remove all existing subnets first and then add this new one. This is wrong.
After a discussion, we decide to update the logic to add this new subnet to the list instead of clearing the list. To reduce the impacts to the least, the code change only impact such case: vnet is specified with a existing value and subnet is not specified. All other cases will not be impacted and follow original logic.
History Notes:
(Fill in the following template if multiple notes are needed, otherwise PR title will be used for history note.)
[Component Name 1] (BREAKING CHANGE:) (az command:) make some customer-facing change.
[Component Name 2] (BREAKING CHANGE:) (az command:) make some customer-facing change.
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.