我在ARM模板:ARM模板CONCAT资源
"parameters": {
"applications": {
"value": "app1|app2|...|app(n)"
}
},
"variables": {
"applications": "[split(parameters('applications'), '|')]"
},
{
"name": "[concat('notificationhub', copyIndex())]",
"type": "Microsoft.Resources/deployments",
"apiVersion": "2016-09-01",
"dependsOn": [
"[concat('Microsoft.NotificationHubs/namespaces/',variables('notificationHubNamespace'))]"
],
"copy": {
"name": "notificationhubCopy",
"count": "[length(variables('applications'))]"
},
"parameters": {
"notificationHubNamespace": { "value" : "variables('notificationHubNamespace')]" },
"notificationHubName": { "value": "[concat('notificationhub-', variables('applications')[copyIndex()])]" },
...
}
}
},
如何Concat的创建notificationhub1和notificationhub2成一个值在应用程序的设置,如
“notificationhub1.connection | notificationhub2.connection | ... | notificationhub(n).connection“
或者有没有一个选项可以在应用程序设置中根据具有相应值的计数属性动态创建?
{
"name": "[variables('webappName')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"resources": [
{
"name": "appsettings",
"type": "config",
"properties": {
"MobileApps": "[parameters('applications')]",
"NotificationHubs": "???",
-- OR --
"App1NotificationHub": "notificationhub1.connection"
"App2NotificationHub": "notificationhub2.connection"
"App(n)NotificationHub": "notificationhubn(n).connection"
}
}
},
你想连接什么?资源ID? – 4c74356b41
我想concat [listKeys('''Microsoft.EventHub/namespaces/authorizationRules','eventHubNamespaceName','keyName'),'2015-08-01')。primaryConnectionString] foreach应用程序。或者我使用其他方式在应用程序设置中包含每个应用程序的eventhub。 – Leszek
concat用什么? – 4c74356b41