Template for deploying VMSS with Public IP Prefix
{"type": "microsoft.compute/virtualmachinescalesets", "apiversion": "2020-06-01", "name": "[parameters('vmssname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('vmsku')]", "tier": "standard", "capacity": "[parameters('instancecount')]"}, "properties": {"overprovision": false, "upgradepolicy": {"mode": "manual"}, "virtualmachineprofile": {"storageprofile": {"osdisk": {"caching": "readonly", "createoption": "fromimage"}, "imagereference": "[variables('imagereference')]"}, "osprofile": {"computernameprefix": "[parameters('vmssname')]", "adminusername": "[parameters('adminusername')]", "adminpassword": "[parameters('adminpasswordorkey')]", "linuxconfiguration": "[if(equals(parameters('authenticationtype'), "password'), json('null'), variables('linuxconfiguration'))]"}, "networkprofile": {"networkinterfaceconfigurations": [{"name": "[variables('nicname')]", "properties": {"primary": true, "ipconfigurations": [{"name": "[variables('ipconfigname')]", "properties": {"subnet": {"id": "[format('{0}/subnets/{1}", resourceid('microsoft.network/virtualnetworks", variables('virtualnetworkname')), variables('subnetname'))]"}, "publicipaddressconfiguration": {"name": "pub1", "properties": {"idletimeoutinminutes": 15, "publicipprefix": {"id": "[resourceid('microsoft.network/publicipprefixes", variables('publicipprefixname'))]"}}}, "loadbalancerbackendaddresspools": [{"id": "[format('{0}/backendaddresspools/{1}", resourceid('microsoft.network/loadbalancers", variables('loadbalancername')), variables('bepoolname'))]"}], "loadbalancerinboundnatpools": [{"id": "[format('{0}/inboundnatpools/{1}", resourceid('microsoft.network/loadbalancers", variables('loadbalancername')), variables('natpoolname'))]"}]}}]}}]}}}, "dependson": ["[resourceid('microsoft.network/loadbalancers", variables('loadbalancername'))]", "[resourceid('microsoft.network/publicipprefixes", variables('publicipprefixname'))]", "[resourceid('microsoft.network/virtualnetworks", variables('virtualnetworkname'))]"]} 