【发布时间】:2021-09-20 05:41:17
【问题描述】:
我在 azure 中使用 ARM 模板从应用服务获取可能的OutboundIpAddresses,并使用它在 mysql 服务器中创建允许防火墙规则
下面是我用来获取ips的参数
"parameters": {
"webAppOutboundIpAddresses": {
"value": "[split(reference(concat('Microsoft.Web/sites/',parameters('wpsitename'))).properties.possibleOutboundIpAddresses,',')]"
以下是链接模板中使用的一段代码。
"type": "Microsoft.DBforMySQL/servers/firewallRules",
"apiVersion": "2017-12-01",
"name": "[concat(parameters('sqlServerName'), '/Allow WebApp Outbound IP ',copyIndex('webAppOutboundIPAddressesCopy'))]",
"properties": {
"startIpAddress": "[parameters('webAppOutboundIpAddresses')[copyIndex('webAppOutboundIPAddressesCopy')]]",
"endIpAddress": "[parameters('webAppOutboundIpAddresses')[copyIndex('webAppOutboundIPAddressesCopy')]]"
},
"copy": {
"name": "webAppOutboundIPAddressesCopy",
"count": "[length(parameters('webAppOutboundIpAddresses'))]"
但不知何故,管道出现故障,我收到无效参数错误
InvalidParameterValue",
"message": "Invalid value given for parameter '{0}'. Specify a valid parameter value."
我注意到的另一件事是输出 IP 显示在方括号内,例如 ["192.168.1.2"]
有人可以解释一下吗?谢谢
【问题讨论】:
标签: azure azure-web-app-service azure-resource-manager arm-template