About VMSS with Public IP with "Routing preference > Internet"

realquest 20 Reputation points

for example,

i have 10 VM though VMSS, and i want public ip with "Routing preference > Internet",

is there only way to create Public IP one by one? (Azure portal -> IP addresses -> Add -> connect each VM)

or how to make 10 "Routing preference > Internet" Public IP at once?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
5,297 questions
Azure VMware Solution
Azure VMware Solution
An Azure service that runs native VMware workloads on Azure.
230 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
1,421 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 14,092 Reputation points Microsoft Employee

    @realquest Thanks for posting your query on Microsoft Q&A.

    You can create IP addresses with routing preference - Internet using the CLI with this command:

    az network public-ip create \
        --resource-group TutorVMRoutePref-rg \
        --name myPublicIP \
        --version IPv4 \
        --ip-tags 'RoutingPreference=Internet' \
        --sku Standard \
        --zone 1 2 3

    You can programmatically achieve your goal using this command, by writing a script for your scenario.

    Reference doc: https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/configure-routing-preference-virtual-machine-cli#create-a-public-ip-address

    Let me know if that helps.

    0 comments No comments