Gregory Suvalian
Gregory Suvalian

Reputation: 3832

How do I get private IP address of first VMSS instance in ARM?

I need to add IP address of any server in VMSS to DNS and hence used following ARM expression to get it untill run into the issue where first instance is no longer 0 (for example where old instance is deleted or autoscale operation was performed). I can not figure out what a solution might be to reliably get information about instance number of any instance inside VMSS.

The reason I need this functionality is that VMSS instances host FTP service which shall be accessed by internal clients and putting VMSS behing LB is not an option due to the fact how FTP using data channel ports.

This record is then inserted into DNS as A record for ftp

"instanceNic-0": "[concat('/subscriptions/',subscription().subscriptionId, '/resourceGroups/',resourceGroup().name,'/providers/Microsoft.Compute/virtualMachineScaleSets/', variables('namingInfix'),'/virtualMachines/0/networkInterfaces/', variables('nicName'))]",

Upvotes: 0

Views: 214

Answers (1)

fitzgeraldsteele
fitzgeraldsteele

Reputation: 4557

Scale set instances are not currently tracked in ARM (they are child instances of the scaleset, and whole lifecycle is managed by the scale set object). So you can use REST API or CLI/powershell to get private ip addresses, but private ip is not directly accessible via ARM templates at the moment.

Azure recently released a preview of VMSS with Flexible Orchestration, where the scale set uses regular 'standalone' IaaS VMs. Since those are fully tracked by ARM, you should be able to use ARM expressions to get NIC IP info.

Upvotes: 1

Related Questions