0
快速问题。如何使用模板创建安装?你能给个例子吗?如何构建'InstallationTemplate'对象。Azure通知集线器安装
快速问题。如何使用模板创建安装?你能给个例子吗?如何构建'InstallationTemplate'对象。Azure通知集线器安装
当你想基于对Microsoft.NotificationHubs的JSON模式创建一个ARM模板:
你会看到这一点:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
},
"variables": {
},
"resources": [
],
"outputs": {
}
}
然后通过键入apiVersion与资源部分开始(请注意,您获得智能的话):
"resources": [
{
"apiVersion": ""
}
],
在此之后添加类型:只要选择正确的值。
类型设置后。您将获得允许的属性的智能感知。 有更多参数可用。但是,当使用主要属性和 创建硬编码值的参数,并在最后,你会得到一个模板,如:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"namespaceLocation": {
"type": "string"
},
"namespaceName": {
"type": "string"
},
"notificationHubName": {
"type": "string"
}
},
"variables": {
},
"resources": [
{
"apiVersion": "2014-09-01",
"name": "[parameters('namespaceName')]",
"type": "Microsoft.NotificationHubs/namespaces",
"location": "[parameters('namespaceLocation')]",
"properties": {
"name": "[parameters('namespaceName')]",
"namespaceType": "NotificationHub"
},
"resources": [
{
"apiVersion": "2014-09-01",
"name": "[parameters('notificationHubName')]",
"type": "Microsoft.NotificationHubs/namespaces/notificationHubs",
"location": "[parameters('namespaceLocation')]",
"dependsOn": [
"[concat('Microsoft.NotificationHubs/namespaces/', parameters('namespaceName'))]"
],
"properties": {
"name": "[parameters('notificationHubName')]"
}
}
]
}
],
"outputs": {
}
}