az network vnet-gateway
Use an Azure Virtual Network Gateway to establish secure, cross-premises connectivity.
To learn more about Azure Virtual Network Gateways, visit https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-howto-site-to-site-resource-manager-cli.
Commands
Name | Description | Type | Status |
---|---|---|---|
az network vnet-gateway create |
Create a virtual network gateway. |
Core | GA |
az network vnet-gateway delete |
Delete a virtual network gateway. |
Core | GA |
az network vnet-gateway list |
List virtual network gateways. |
Core | GA |
az network vnet-gateway revoked-cert |
Manage revoked certificates in a virtual network gateway. Prevent machines using this certificate from accessing Azure through this gateway. |
Core | GA |
az network vnet-gateway revoked-cert create |
Revoke a certificate. |
Core | GA |
az network vnet-gateway revoked-cert delete |
Delete a revoked certificate. |
Core | GA |
az network vnet-gateway revoked-cert wait |
Place the CLI in a waiting state until a condition is met. |
Core | GA |
az network vnet-gateway root-cert |
Manage root certificates of a virtual network gateway. |
Core | GA |
az network vnet-gateway root-cert create |
Upload a root certificate. |
Core | GA |
az network vnet-gateway root-cert delete |
Delete a root certificate. |
Core | GA |
az network vnet-gateway root-cert wait |
Place the CLI in a waiting state until a condition is met. |
Core | GA |
az network vnet-gateway show |
Get the details of a virtual network gateway. |
Core | GA |
az network vnet-gateway update |
Update a virtual network gateway. |
Core | GA |
az network vnet-gateway vpn-client |
Download a VPN client configuration required to connect to Azure via point-to-site. |
Core | GA |
az network vnet-gateway vpn-client generate |
Generate VPN client configuration. |
Core | GA |
az network vnet-gateway wait |
Place the CLI in a waiting state until a condition is met. |
Core | GA |
az network vnet-gateway create
Create a virtual network gateway.
az network vnet-gateway create --name
--public-ip-address
--resource-group
--vnet
[--address-prefix]
[--asn]
[--bgp-peering-address]
[--gateway-default-site]
[--gateway-type {ExpressRoute, Vpn}]
[--location]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--peer-weight]
[--root-cert-data]
[--root-cert-name]
[--sku {Basic, HighPerformance, Standard}]
[--tags]
[--vpn-type {PolicyBased, RouteBased}]
Examples
Create a basic virtual network gateway for site-to-site connectivity.
az network vnet-gateway create -g MyResourceGroup -n MyVnetGateway --public-ip-address MyGatewayIp --vnet MyVnet --gateway-type Vpn --sku VpnGw1 --vpn-type RouteBased --no-wait
Create a virtual network gateway.
az network vnet-gateway create --gateway-type Vpn --location westus2 --name MyVnetGateway --no-wait --public-ip-addresses myVGPublicIPAddress --resource-group MyResourceGroup --sku Basic --vnet MyVnet --vpn-type PolicyBased
Required Parameters
Name of the VNet gateway.
Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'.
Optional Parameters
Space-separated list of CIDR prefixes representing the address space for the P2S Vpnclient. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more. Singular flags: --address-prefix
.
Autonomous System Number to use for the BGP settings.
IP address to use for BGP peering.
Name or ID of a local network gateway representing a local network site with default routes.
The gateway type.
Location. Values from: az account list-locations
. You can configure the default location using az configure --defaults location=<location>
.
Do not wait for the long-running operation to finish.
Weight (0-100) added to routes learned through BGP peering.
Base64 contents of the root certificate file or file path.
Root certificate name.
VNet gateway SKU.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
VPN routing type.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az network vnet-gateway delete
Delete a virtual network gateway.
In order to delete a Virtual Network Gateway, you must first delete ALL Connection objects in Azure that are connected to the Gateway. After deleting the Gateway, proceed to delete other resources now not in use. For more information, follow the order of instructions on this page: https://docs.microsoft.com/azure/vpn-gateway/vpn-gateway-delete-vnet-gateway-portal.
az network vnet-gateway delete [--ids]
[--name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
Examples
Delete a virtual network gateway.
az network vnet-gateway delete -g MyResourceGroup -n MyVnetGateway
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the VNet gateway.
Do not wait for the long-running operation to finish.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az network vnet-gateway list
List virtual network gateways.
az network vnet-gateway list --resource-group
Examples
List virtual network gateways in a resource group.
az network vnet-gateway list -g MyResourceGroup
Required Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az network vnet-gateway show
Get the details of a virtual network gateway.
az network vnet-gateway show [--ids]
[--name]
[--resource-group]
[--subscription]
Examples
Get the details of a virtual network gateway.
az network vnet-gateway show -g MyResourceGroup -n MyVnetGateway
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the VNet gateway.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az network vnet-gateway update
Update a virtual network gateway.
az network vnet-gateway update [--add]
[--address-prefix]
[--asn]
[--bgp-peering-address]
[--enable-bgp {0, 1, f, false, n, no, t, true, y, yes}]
[--force-string {0, 1, f, false, n, no, t, true, y, yes}]
[--gateway-default-site]
[--gateway-type {ExpressRoute, Vpn}]
[--ids]
[--name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--peer-weight]
[--public-ip-address]
[--remove]
[--resource-group]
[--root-cert-data]
[--root-cert-name]
[--set]
[--sku {Basic, HighPerformance, Standard}]
[--subscription]
[--tags]
[--vnet]
[--vpn-type {PolicyBased, RouteBased}]
Examples
Change the SKU of a virtual network gateway.
az network vnet-gateway update -g MyResourceGroup -n MyVnetGateway --sku VpnGw2
Optional Parameters
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.
Space-separated list of CIDR prefixes representing the address space for the P2S Vpnclient. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more. Singular flags: --address-prefix
.
Autonomous System Number to use for the BGP settings.
IP address to use for BGP peering.
Enable BGP (Border Gateway Protocol).
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
Name or ID of a local network gateway representing a local network site with default routes.
The gateway type.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Name of the VNet gateway.
Do not wait for the long-running operation to finish.
Weight (0-100) added to routes learned through BGP peering.
Specify a single public IP (name or ID) for an active-standby gateway. Specify two space-separated public IPs for an active-active gateway. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Base64 contents of the root certificate file or file path.
Root certificate name.
Update an object by specifying a property path and value to set. Example: --set property1.property2=.
VNet gateway SKU.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Name or ID of an existing virtual network which has a subnet named 'GatewaySubnet'.
VPN routing type.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az network vnet-gateway wait
Place the CLI in a waiting state until a condition is met.
az network vnet-gateway wait [--created]
[--custom]
[--deleted]
[--exists]
[--ids]
[--interval]
[--name]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
Optional Parameters
Wait until created with 'provisioningState' at 'Succeeded'.
Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].
Wait until deleted.
Wait until the resource exists.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Polling interval in seconds.
Name of the VNet gateway.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Maximum wait in seconds.
Wait until updated with provisioningState at 'Succeeded'.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for