az network public-ip

Manage public IP addresses.

To learn more about public IP addresses visit https://docs.microsoft.com/azure/virtual-network/virtual-network-public-ip-address.

Commands

az network public-ip create

Create a public IP address.

az network public-ip delete

Delete a public IP address.

az network public-ip list

List public IP addresses.

az network public-ip prefix

Manage public IP prefix resources.

az network public-ip prefix create

Create a public IP prefix resource.

az network public-ip prefix delete

Delete a public IP prefix resource.

az network public-ip prefix list

List public IP prefix resources.

az network public-ip prefix show

Get the details of a public IP prefix resource.

az network public-ip prefix update

Update a public IP prefix resource.

az network public-ip show

Get the details of a public IP address.

az network public-ip update

Update a public IP address.

az network public-ip create

Create a public IP address.

az network public-ip create --name
                            --resource-group
                            [--allocation-method {Dynamic, Static}]
                            [--dns-name]
                            [--edge-zone]
                            [--idle-timeout]
                            [--ip-address]
                            [--ip-tags]
                            [--location]
                            [--public-ip-prefix]
                            [--reverse-fqdn]
                            [--sku {Basic, Standard}]
                            [--tags]
                            [--tier {Global, Regional}]
                            [--version {IPv4, IPv6}]
                            [--zone {1, 2, 3}]

Examples

Create a basic public IP resource.

az network public-ip create -g MyResourceGroup -n MyIp

Create a static public IP resource for a DNS name label.

az network public-ip create -g MyResourceGroup -n MyIp --dns-name MyLabel --allocation-method Static

Create a public IP resource in an availability zone in the current resource group region.

az network public-ip create -g MyResourceGroup -n MyIp --zone 2

Required Parameters

--name -n

The name of the public IP address.

--resource-group -g

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

Optional Parameters

--allocation-method

IP address allocation method.

accepted values: Dynamic, Static
--dns-name

Globally unique DNS entry.

--edge-zone

The name of edge zone.

--idle-timeout

Idle timeout in minutes.

default value: 4
--ip-address

The IP address associated with the public IP address resource.

--ip-tags

Space-separated list of IP tags in 'TYPE=VAL' format.

--location -l

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

--public-ip-prefix

Name or ID of a public IP prefix.

--reverse-fqdn

Reverse FQDN (fully qualified domain name).

--sku

Name of a public IP address SKU.

accepted values: Basic, Standard
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--tier

Tier of a public IP address SKU and Global tier is only supported for standard SKU public IP addresses.

accepted values: Global, Regional
--version

IP address type.

accepted values: IPv4, IPv6
default value: IPv4
--zone -z

Space-separated list of availability zones into which to provision the resource.

accepted values: 1, 2, 3

az network public-ip delete

Delete a public IP address.

az network public-ip delete [--ids]
                            [--name]
                            [--resource-group]

Examples

Delete a public IP address.

az network public-ip delete -g MyResourceGroup -n MyIp

Optional Parameters

--ids

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

The name of the public IP address.

--resource-group -g

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

az network public-ip list

List public IP addresses.

az network public-ip list [--resource-group]

Examples

List all public IPs in a subscription.

az network public-ip list

List all public IPs in a resource group.

az network public-ip list -g MyResourceGroup

List all public IPs of a domain name label.

az network public-ip list -g MyResourceGroup --query "[?dnsSettings.domainNameLabel=='MyLabel']"

Optional Parameters

--resource-group -g

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

az network public-ip show

Get the details of a public IP address.

az network public-ip show [--expand]
                          [--ids]
                          [--name]
                          [--resource-group]

Examples

Get information about a public IP resource.

az network public-ip show -g MyResourceGroup -n MyIp

Get the FQDN and IP address of a public IP resource.

az network public-ip show -g MyResourceGroup -n MyIp --query "{fqdn: dnsSettings.fqdn, address: ipAddress}"

Optional Parameters

--expand

Expands referenced resources.

--ids

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

The name of the public IP address.

--resource-group -g

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

az network public-ip update

Update a public IP address.

az network public-ip update [--add]
                            [--allocation-method {Dynamic, Static}]
                            [--dns-name]
                            [--force-string]
                            [--idle-timeout]
                            [--ids]
                            [--ip-tags]
                            [--name]
                            [--public-ip-prefix]
                            [--remove]
                            [--resource-group]
                            [--reverse-fqdn]
                            [--set]
                            [--sku {Basic, Standard}]
                            [--tags]
                            [--version {IPv4, IPv6}]

Examples

Update a public IP resource with a DNS name label and static allocation.

az network public-ip update -g MyResourceGroup -n MyIp --dns-name MyLabel --allocation-method Static

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

--allocation-method

IP address allocation method.

accepted values: Dynamic, Static
--dns-name

Globally unique DNS entry.

--force-string

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

--idle-timeout

Idle timeout in minutes.

--ids

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.

--ip-tags

Space-separated list of IP tags in 'TYPE=VAL' format.

--name -n

The name of the public IP address.

--public-ip-prefix

Name or ID of a public IP prefix.

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

--reverse-fqdn

Reverse FQDN (fully qualified domain name).

--set

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

--sku

Public IP SKU.

accepted values: Basic, Standard
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--version

IP address type.

accepted values: IPv4, IPv6
default value: IPv4