With azure cli 2.0: How to get all private IPs of an azure virtual machine scale set (vmss) # Date: Feb-03-2017 SCALE_SET="" RG="" az vmss nic list --resource-group $RG --vmss-name $SCALE_SET | jq -r '.[] | .ipConfigurations[] | .privateIpAddress' Using the vmss IPs as a dynamic ansible inventory host file as group "agents" #!/usr/bin/env node const exec = require('child_process').exec; const rg = ''; const vmss = ''; const group = 'agents' // _meta is required as a speedup. otherwise it will restart the script every time variables are needed. Slowdown ~30x const result = {'_meta':{'hostvars':{}}}; exec(`az vmss nic list --resource-group ${rg} --vmss-name ${vmss}`, function(err, stdout, stderr) { const json = JSON.parse(stdout); const hosts = json.map((e) => { return e.ipConfigurations[0].privateIpAddress }) result[group] = {'hosts': hosts} console.log(JSON.stringify(result)); });