How to add VMSS as a backend target type using az cli command?

Raja, Vijay 25 Reputation points
2024-08-09T22:56:34.1966667+00:00

I am trying to update the backend with VMSS, but encountering this error:

ERROR: (ApplicationGatewayBackendAddressMustHaveEitherFqdnOrIpAddress) Backend Address Pool newpassmetScaleSet-1723238703-backend must have either Fqdn or IpAddress specified.

Code: ApplicationGatewayBackendAddressMustHaveEitherFqdnOrIpAddress

How can I fix this issue?

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,509 questions
Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,081 questions
{count} votes

Accepted answer
  1. Rohith Vinnakota 1,085 Reputation points Microsoft Vendor
    2024-09-17T19:31:23.6033333+00:00

    Hi Raja, Vijay,

    Apologies on the misunderstanding,

    I understand that you're looking to add a VMSS to the backend pool of the Application Gateway

    There are two methods, depending on which orchestration mode you are using for your VMSS

    When adding Uniform Virtual Machine Scale Sets to an Application Gateway's backend pool, the process will vary. Use the following command

    appGWName=<appGwName>
    appGWResourceGroup=<appGWRGName>
    backendPoolName=<backendPoolName>
    backendPoolId=$(az network application-gateway address-pool show --gateway-name $appGWName -g $appGWResourceGroup -n $backendPoolName --query id -otsv)
     
    vmssName=<vmssName>
    vmssResourceGroup=<vmssRGName>
     
    # add app gw backend pool to first nic's first ip config
    az vmss update -n $vmssName -g $vmssResourceGroup --add "virtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].ipConfigurations[0].applicationGatewayBackendAddressPools" "id=$backendPoolId"
     
    # update instances
    az vmss update-instances --instance-ids * --name $vmssName --resource-group $vmssResourceGroup
    

    For additional reference, please visit this link: Networking for Azure Virtual Machine Scale Sets - Azure Virtual Machine Scale Sets | Microsoft Learn

    When adding Flexible Orchestration VMSS to an Application Gateway, the process differs from adding Uniform VMSS.

    When adding a Flexible Scale Set to an Application Gateway, the procedure is similar to adding standalone VMs to the backend pool. You need to update the network interface IP configuration of the virtual machines to include them in the backend pool. This can be achieved either by adjusting the Application Gateway's configuration or by modifying the network interface settings of the virtual machines.

    Thanks,
    Rohith


    If you have questions about this, please let us know in the comments. We are glad to help you.

    If the information is helpful, please click on "Upvote" and "Accept Answer" so that it would be helpful to other community members.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.