az network local-gateway

Commands

az network local-gateway create Create a local VPN gateway.
az network local-gateway delete Delete a local VPN gateway.
az network local-gateway list List all local VPN gateways in a resource group.
az network local-gateway show Get the details of a local VPN gateway.
az network local-gateway update Update a local VPN gateway.
az network local-gateway wait Place the CLI in a waiting state until a condition of the local gateway is met.

az network local-gateway create

Create a local VPN gateway.

az network local-gateway create --gateway-ip-address
--name
--resource-group
[--asn]
[--bgp-peering-address]
[--local-address-prefixes]
[--location]
[--no-wait]
[--peer-weight]
[--subscription]
[--tags]

Examples

Create a Local Network Gateway to represent your on-premises site.

az network local-gateway create -g MyResourceGroup -n MyLocalGateway \
                            --gateway-ip-address 23.99.221.164 --local-address-prefixes 10.0.0.0/24 20.0.0.0/24

Required Parameters

--gateway-ip-address

Gateway's public IP address. (e.g. 10.1.1.1).

--name -n

Name of the local network gateway.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--asn

Autonomous System Number to use for the BGP settings.

--bgp-peering-address

IP address from the OnPremise VPN's subnet to use for BGP peering.

--local-address-prefixes

List of CIDR block prefixes representing the address space of the OnPremise VPN's subnet.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--no-wait

Do not wait for the long-running operation to finish.

--peer-weight

Weight (0-100) added to routes learned through BGP peering.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags in 'key[=value]' format. Use "" to clear existing tags.

az network local-gateway delete

Delete a local VPN gateway.

az network local-gateway delete [--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]

Examples

Create a Local Network Gateway to represent your on-premises site.

az network local-gateway delete -g MyResourceGroup -n MyLocalGateway

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the local network gateway.

--no-wait

Do not wait for the long-running operation to finish.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az network local-gateway list

List all local VPN gateways in a resource group.

az network local-gateway list --resource-group
[--subscription]

Examples

List all local VPN gateways in a resource group.

az network local-gateway list -g MyResourceGroup

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az network local-gateway show

Get the details of a local VPN gateway.

az network local-gateway show [--ids]
[--name]
[--resource-group]
[--subscription]

Examples

Get the details of a local VPN gateway.

az network local-gateway show -g MyResourceGroup -n MyLocalGateway

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the local network gateway.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az network local-gateway update

Update a local VPN gateway.

az network local-gateway update [--add]
[--asn]
[--bgp-peering-address]
[--force-string]
[--gateway-ip-address]
[--ids]
[--local-address-prefixes]
[--name]
[--no-wait]
[--peer-weight]
[--remove]
[--resource-group]
[--set]
[--subscription]
[--tags]

Examples

Update a Local Network Gateway provisioned with a 10.0.0.0/24 address prefix with additional prefixes.

az network local-gateway update -g MyResourceGroup -n MyLocalGateway \
                            --local-address-prefixes 10.0.0.0/24 20.0.0.0/24 30.0.0.0/24

Optional Parameters

--add

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

--asn

Autonomous System Number to use for the BGP settings.

--bgp-peering-address

IP address from the OnPremise VPN's subnet to use for BGP peering.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--gateway-ip-address

Gateway's public IP address. (e.g. 10.1.1.1).

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--local-address-prefixes

List of CIDR block prefixes representing the address space of the OnPremise VPN's subnet.

--name -n

Name of the local network gateway.

--no-wait

Do not wait for the long-running operation to finish.

--peer-weight

Weight (0-100) added to routes learned through BGP peering.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags in 'key[=value]' format. Use "" to clear existing tags.

az network local-gateway wait

Place the CLI in a waiting state until a condition of the local gateway is met.

az network local-gateway wait [--created]
[--custom]
[--deleted]
[--exists]
[--ids]
[--interval]
[--name]
[--resource-group]
[--subscription]
[--timeout]
[--updated]

Examples

Wait for Local Network Gateway to return as created.

az network local-gateway wait -g MyResourceGroup -n MyLocalGateway --created

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

--exists

Wait until the resource exists.

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--interval

Polling interval in seconds.

default value: 30
--name -n

Name of the local network gateway.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Maximum wait in seconds.

default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.