How to attach the network interface that have public IP to scaleset vm with application gateway

kokioji 0 Reputation points
2023-03-15T00:20:40.15+00:00

I want to attach a network interface that have public IP to scaleset vm with application gateway.

Is it possible?

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.
2,167 questions
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
348 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sina Salam 3,886 Reputation points
    2023-03-15T00:47:55.57+00:00

    @kokioji

    Welcome to Microsoft Q&A and thank you for posting your question here!!

    To attach network interface that have a public IP address, by default there will be allocated public-ip address to VM. You can create a scale set with configurable virtual machine domain names using below information as a sample JSON code:

    "networkProfile": {
      "networkInterfaceConfigurations": [
        {
        "name": "nic1",
        "properties": {
          "primary": true,
          "ipConfigurations": [
          {
            "name": "ip1",
            "properties": {
              "subnet": {
                "id": "[concat('/subscriptions/', subscription().subscriptionId,'/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Network/virtualNetworks/', variables('vnetName'), '/subnets/subnet1')]"
              },
              "publicIPAddressconfiguration": {
                "name": "publicip",
                "properties": {
                "idleTimeoutInMinutes": 10,
                  "dnsSettings": {
                    "domainNameLabel": "[parameters('vmssDnsName')]"
                  }
                }
              }
            }
          }
        ]
        }
    }
    

    Also, you can create a scale set with public IP per virtual machine with following JSON sample code.

    "publicIpAddressConfiguration": {
        "name": "pub1",
        "sku": {
          "name": "Standard"
        },
        "properties": {
          "idleTimeoutInMinutes": 15
        }
    }
    

    Likewise, you can configure multiple IP address per NIC.

    Have a good success in your configurations and let me know if this information help you or you need more details.

    Cheers,

    Sina


  2. KapilAnanth-MSFT 35,416 Reputation points Microsoft Employee
    2023-03-15T08:56:55.05+00:00

    @kokioji

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    I understand that you would like to add a VMSS behind an App gateway.

    I am not sure why having a public IP on the NIC of a VMSS should matter, however, you can always add a VMSS as backend pool of App Gateway.

    Refer : https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-components#backend-pools

    Kindly let us know if the above helps or you need further assistance on this issue.

    Thanks,

    Kapil


    Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.