For API versions older than 2020-08-01, use the code above without specifying a zone parameter for a Standard SKU to create a zone-redundant IP address.
הערה
The above options for zones are only valid selections in regions with Availability Zones.
Zonal
The code in this section creates a standard zonal public IPv4 address named myStandardPublicIP-zonal.
To create a standard zonal public IP address in Zone 2, the "zones" property contains a '2'.
The above options for zones are only valid selections in regions with Availability Zones.
Create standard public IP without zones
In this section, you create a non-zonal IP address.
The code in this section creates a standard no-zone public IPv4 address named myStandardPublicIP. The code section is valid for all regions with or without Availability Zones.
To create an IPv6 address, modify the publicIPAddressVersion parameter to IPv6.
If it's acceptable for the IP address to change over time, publicIPAllocationMethod IP assignment can be selected by changing the AllocationMethod to Dynamic.
הערה
A basic IPv6 address must always be Dynamic.
Routing preference and tier
Standard SKU static public IPv4 addresses support Routing Preference or the Global Tier feature.
Routing preference
By default, the routing preference for public IP addresses is set to Microsoft network, which delivers traffic over Microsoft's global wide area network to the user.
The selection of Internet minimizes travel on Microsoft's network, instead using the transit ISP network to deliver traffic at a cost-optimized rate.
Public IP addresses are associated with a single region. The Global tier spans an IP address across multiple regions. Global tier is required for the frontends of cross-region load balancers.
In this quickstart, you learn how to create a public IP address for a Standard SKU and a Basic SKU. You also learn about routing preferences and tiers.