Skip to content

Conversation

@arrownj
Copy link
Contributor

@arrownj arrownj commented May 14, 2020

Description
We will support vnet/subnet for local context by default just as resource_group do. If the argument name is defined as vnet_name and subnet, it will support local context GET action automatically.

Testing Guide

  • az local-context on

Command group 'local-context' is experimental and not covered by customer support. Please use with discretion.
Local context is turned on, you can run az local-context off to turn it off.

  • az network vnet create -g myRG -n my-vnet-1 --subnet-name my-subnet-1

Local context is turned on. Its information is saved in working directory D:\code\cli\azure-cli. You can run az local-context off to turn it off.
Command argument values saved to local context: --resource-group: xiaojianxu, --name: xxj-vnet-1, --subnet-name: xxj-subnet-1
{
"newVNet": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/16"
]
},
...
}

  • az acr network-rule add -h

Command
az acr network-rule add : Add a network rule.

Arguments
--name -n [Required] : The name of the container registry. You can configure the default
registry name using az configure --defaults acr=<registry name>.
--ip-address : IPv4 address or CIDR range.
--resource-group -g : Name of resource group. You can configure the default group using az configure --defaults group=<name>. Local Context: myRG.
--subnet : Name or ID of subnet. If name is supplied, --vnet-name must be
supplied. Local Context: my-subnet-1.
--vnet-name : Name of a virtual network. Local Context: my-vnet-1.

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 feature.


This checklist is used to make sure that common guidelines for a pull request are followed.

@arrownj
Copy link
Contributor Author

arrownj commented May 14, 2020

local context

@arrownj arrownj requested a review from yungezz May 14, 2020 06:03
@jiasli jiasli requested a review from mmyyrroonn May 14, 2020 08:13
Comment on lines +374 to +375
c.argument('vnet_name', vnet_name_type)
c.argument('subnet', subnet_name_type)
Copy link
Member

@jiasli jiasli May 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is somehow contradicting my understanding about vnet_name and subnet. But, yea, they can only be configured as global arguments.

@arrownj arrownj merged commit 989924e into Azure:dev May 14, 2020
@arrownj arrownj deleted the load_vnet_subnet_global_definition_for_local_context branch July 29, 2020 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants