Is it possible to get the list of all instances of a virtual machine scaleset from within the ARM template deployment as an output? I am deploying an ARM template which creates a virtual machine scaleset with 3 instances. As part of the deployment output, I want the list of all the VM's inside the scaleset. I have tried these so far -
"value": "[reference(concat('/subscriptions/SubscriptionID/resourceGroups/ResourceGrpName/providers/Microsoft.Compute/virtualMachineScaleSets/ScalesetName'), '2019-12-01', 'Full')]" - This only returns the scaleset information.
"value": "[reference(concat('/subscriptions/SubscriptionID/resourceGroups/ResourceGrpName/providers/Microsoft.Compute/virtualMachineScaleSets//virtualMachines'), '2019-12-01', 'Full')]" - This returns an error - "The resource namespace 'subscriptions' is invalid."
There is a similar REST API mentioned here - https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-instance-ids which works.