This command creates a new public IP address resource.A DNS record is created for
$dnsPrefix.$location.cloudapp.azure.com pointing to the public IP address of this resource. A
public IP address is immediately allocated to this resource as the -AllocationMethod is specified
as 'Static'. If it is specified as 'Dynamic', a public IP address gets allocated only when you
start (or create) the associated resource (like a VM or load balancer).
Example 2: Create a public IP address with a reverse FQDN
This command creates a new public IP address resource. With the -ReverseFqdn parameter, Azure
creates a DNS PTR record (reverse-lookup) for the public IP address allocated to this resource,
pointing to the $customFqdn specified in the command. As a pre-requisite, the $customFqdn (say
webapp.contoso.com) should have a DNS CNAME record (forward-lookup) pointing to
$dnsPrefix.$location.cloudapp.azure.com.
Example 3: Create a new public IP address with IpTag
This command creates a new public IP address resource.A DNS record is created for
$dnsPrefix.$location.cloudapp.azure.com pointing to the public IP address of this resource. A
public IP address is immediately allocated to this resource as the -AllocationMethod is specified
as 'Static'. If it is specified as 'Dynamic', a public IP address gets allocated only when you
start (or create) the associated resource (like a VM or load balancer). An Iptag is used to
specific the Tags associated with resource. Iptag can be specified using New-AzPublicIpTag
and passed as input through -IpTags.
Example 4: Create a new public IP address from a Prefix
This command creates a new public IP address resource. A DNS record is created for
$dnsPrefix.$location.cloudapp.azure.com pointing to the public IP address of this resource. A
public IP address is immediately allocated to this resource from the publicIpPrefix specified.
This option is only supported for the 'Standard' Sku and 'Static' AllocationMethod.
Example 5: Create a specific public IP address from a BYOIP Prefix
This command creates a new public IP address resource with specific IP. NRP would check if the
given IP is inside the PublicIpPrefix and if the given PublicIpPrefix is BYOIP PublicIpPrefix.
the given public IP address is immediately allocated to this resource from the publicIpPrefix
specified. This option is only supported for the 'Standard' Sku and 'Static' AllocationMethod
and BYOIP PublicIpPrefix.
Example 6: Create a new global public IP address
$publicIp = New-AzPublicIpAddress -Name $publicIpName -ResourceGroupName $rgName -AllocationMethod Static -DomainNameLabel $domainNameLabel -Location $location -Sku Standard -Tier Global
This command creates a new global public IP address resource.A DNS record is created for
$dnsPrefix.$location.cloudapp.azure.com pointing to the public IP address of this resource. A
global public IP address is immediately allocated to this resource.
This option is only supported for the 'Standard' Sku and 'Static' AllocationMethod.
Example 7: Create a public IP address with a DomainNameLabelScope
This command creates a new public IP address resource. With the -DomainNameLabelScope parameter, Azure
creates a DNS record with a hashed value in FQDN for the public IP address allocated to this resource
with the policy suggested by $hasedReusePolicy.
Parameters
-AllocationMethod
Specifies the method with which to allocate the public IP address.
The acceptable values for this parameter are: Static or Dynamic.
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.