Configure routing preference for a public IP address

This article shows you how to configure routing preference via ISP network (Internet option) for a public IP address using the Azure portal, Azure PowerShell, or Azure CLI. After creating the public IP address, you can associate it with the following Azure resources for inbound and outbound traffic to the internet:

  • Virtual machine
  • Virtual machine scale set
  • Azure Kubernetes Service (AKS)
  • Internet-facing load balancer
  • Application Gateway
  • Azure Firewall

By default, the routing preference for public IP address is set to the Microsoft global network for all Azure services and can be associated with any Azure service.

Prerequisites

If you don't have an Azure subscription, create an Azure free account before you begin.

Create a public IP address with a routing preference

  1. Sign in to the Azure portal.

  2. Select Create a resource.

  3. In the search box, type Public IP address.

  4. In the search results, select Public IP address. Next, in the Public IP address page, select Create.

  5. In the Create public IP address page, enter or select this information:

    Setting Value
    Project details
    Subscription Select your subscription.
    Resource group Select Create new, enter RoutingPreferenceResourceGroup, then select OK.
    Instance details
    Region Select East US.
    Configuration details
    Name Enter a name for the public IP address.
    IP version Select IPv4.
    SKU Select Standard.
    Tier Select Regional.
    Availability zone Select Zone-redundant.
    IP address assignment Select Static.
    Routing preference Select Internet.
    DNS name label Enter a DNS name label if desired.
  6. Select Create.

    Note

    Public IP addresses are created with an IPv4 or IPv6 address. However, routing preference only supports IPV4 currently.

You can associate the above created public IP address with a Windows or Linux virtual machine. Use the CLI section on the tutorial page: Associate a public IP address to a virtual machine to associate the public IP to your VM. You can also associate the public IP address created above with an Azure Load Balancer, by assigning it to the load balancer frontend configuration. The public IP address serves as a load-balanced virtual IP address (VIP).

Next steps