Azure Resource Manager - Multiple VM NAT Rules -
i trying create arm template provision multiple webservers directly accessible ports. instance want vm have either port 9001 or 9002 open based on index of vm is.
i struggling frontendport parameter accept function. here documentation have used.
here relevant portion of template looks like:
"inboundnatrules": [ { "copy": { "name": "natcopy", "count": "[parameters('numberofvms')]" }, "name": "[concat('directhttps-', copyindex())]", "properties": { "frontendipconfiguration": { "id": "[concat(variables('lbid'),'/frontendipconfigurations/loadbalancerfrontend')]" }, "frontendport": "[add(9001, copyindex())]", "backendport": 9001, "enablefloatingip": false, "idletimeoutinminutes": 4, "protocol": "tcp", "backendipconfiguration": { "id": "[resourceid('microsoft.network/networkinterfaces', concat(variables('vmnicname'), copyindex()), 'ipconfig')]" } } }
]
i hoping particular port result in either "9001", or "9002".
"frontendport": "[add(9001, copyindex())]"
instead, see error in visual studio's intellisense, , when try deploy solution.
create template deployment 'deploymenttemplate-0107-1555'. new-azurermresourcegroupdeployment : resource microsoft.network/loadbalancers 'webserverlb' failed message 'unable process template language expressions resource '/subscriptions/some random guid/resourcegroups/webservers/providers/microsoft.network/loadbalancers/webserverlb' @ line '102' , column '10'. 'the template function 'copyindex' not expected @ location. function can used in resource copy specified.
long story short, i'm trying have same number of nat rules have vm's in template, , dynamically assign external port number.
please let me know if can provide more information. thank you.
you can ask question on msdn networking forum: https://social.msdn.microsoft.com/forums/azure/en-us/home?forum=wavirtualmachinesvirtualnetwork, , azure support help.
Comments
Post a Comment