我在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