Public IP addresses - az network public-ip

Manage public IP addresses.

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 show Show 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]
[--idle-timeout]
[--location]
[--reverse-fqdn]
[--tags]
[--version {IPv4, IPv6}]

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 (for example, MyLabel.westus.cloudapp.azure.com).

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

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

Optional Parameters

--allocation-method

IP address allocation method.

accepted values: Dynamic, Static
default value: Dynamic
--dns-name

Globally unique DNS entry.

--idle-timeout

Idle timeout in minutes.

default value: 4
--location -l

Location. You can configure the default location using az configure --defaults location=.

--reverse-fqdn

Reverse FQDN (fully qualified domain name).

--tags

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

--version

IP address type.

accepted values: IPv4, IPv6
default value: IPv4

az network public-ip delete

Delete a public IP address.

az network public-ip delete --name
--resource-group

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

az network public-ip list

List public IP addresses.

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

Examples

List all public IPs in a resource group.

az network public-ip list -g MyResourceGroup

List all public IPs for a domain name label (for example `MyLabel.eastus.cloudapp.azure.com`).

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

az network public-ip show

Show details of a public IP address.

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

Examples

Get information about a public IP resource.

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

Get FQDN and IP address for a public IP resource.

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

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

Optional Parameters

--expand

Expands referenced resources.

az network public-ip update

Update a public IP address.

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

Examples

Update a public IP resource with a DNS name label (for example, MyLabel.westus.cloudapp.azure.com) and static allocation.

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

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

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty .

--allocation-method

IP address allocation method.

accepted values: Dynamic, Static
--dns-name

Globally unique DNS entry.

--idle-timeout

Idle timeout in minutes.

--remove

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

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

--tags

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

--version

IP address type.

accepted values: IPv4, IPv6
default value: IPv4