本文介绍了使用ARM模板创建多个VNG连接时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 嗨 我需要在不同的订阅中创建从一个虚拟网络网关到另一个(VNG)的多个连接 我正在尝试使用arm模板来完成这项工作,因为我知道其他VGW的ID 我的问题是 RemoteVirtualGatewayID。我无法将其定义为数组,因为资源下的ID 只接受整数。 知道怎么做这个工作吗? 注意 - 我删除了实际ID和提供虚拟价值 {" $ schema":" https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" ," contentVersion":" 1.0.0.0"," parameters" ;: {" RemoteVirtualGatewayID":{" type":" int" ;," defaultValue":[" VGWID1"," VGWI2" ]," metadata":{" description":"" } }," ConnectionName" ;: {" type":" array"," defaultValue":[" ; con1"," con2" ]," metadata":{" description":" Azure Subnet的任意名称" } }," sharedKey" ;: {" type":" SecureString"," metadata":{" ;描述":" IPSec隧道的共享密钥(PSK)" } } }," variables" ;: {" ESMVirtualGatewayID":" GatewayID"," ESMVGWlocation":" ;北欧" }," resources" ;: [ {" type":" Microsoft.Network/connections"," name":" [parameters('ConnectionName')]"," apiVersion":" 2015-06-15"," location":" [variables ('ESMVGWlocation')]"," copy":{" count":" [parameters('ConnectionName')]"," name": " connectionNameloop" }, " copy" ;: {" name":" connectionLoop"," count":" [parameters('RemoteVirtualGatewayID ")]" }," properties":{" virtualNetworkGateway1":{" id":" [variables('ESMVirtualGatewayID')]" }," virtualNetworkGateway2":{" id":" [parameters('RemoteVirtualGatewayID')]" }," connectionType":" Vnet2Vnet"," routingWeight":10," sharedKey":" [parameters('sharedKey')] " } } ] } 解决方案 Hi I've a requirement to create multiple connections from one Virtual network gateway to another ( VNG ) in a different subscriptionI'm trying to get this work using arm template as I know the ID of the other VGWThe issue is I've is with the RemoteVirtualGatewayID. I can't define it as an array as the ID under resources accepts only integer.Any idea how to get this work ?Note - I've removed the actual ID and provided dummy value{ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "RemoteVirtualGatewayID": { "type": "int", "defaultValue": [ "VGWID1", "VGWI2" ], "metadata": { "description": "" } }, "ConnectionName": { "type": "array", "defaultValue": [ "con1", "con2" ], "metadata": { "description": "Arbitrary name for the Azure Subnet" } }, "sharedKey": { "type": "SecureString", "metadata": { "description": "Shared key (PSK) for IPSec tunnel" } } }, "variables": { "ESMVirtualGatewayID": "GatewayID", "ESMVGWlocation": "North Europe" }, "resources": [ { "type": "Microsoft.Network/connections", "name": "[parameters('ConnectionName')]", "apiVersion": "2015-06-15", "location": "[variables('ESMVGWlocation')]", "copy":{ "count": "[parameters('ConnectionName')]", "name": "connectionNameloop" }, "copy": { "name": "connectionLoop", "count": "[parameters('RemoteVirtualGatewayID')]" }, "properties": { "virtualNetworkGateway1": { "id": "[variables('ESMVirtualGatewayID')]" }, "virtualNetworkGateway2": { "id": "[parameters('RemoteVirtualGatewayID')]" }, "connectionType": "Vnet2Vnet", "routingWeight": 10, "sharedKey": "[parameters('sharedKey')]" } } ]} 解决方案 这篇关于使用ARM模板创建多个VNG连接时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-18 22:09