Updated ARM template. Added ARM template to configure TLS/SSL cert for app services
This commit is contained in:
Родитель
ccc07c5d06
Коммит
80e5a1355f
|
@ -1,6 +1,10 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"metadata" : {
|
||||
"comments": "This ARM template deploys Azure resources included in the Health Bot Reference Architecture",
|
||||
"author": "Microsoft Healthcare CSU"
|
||||
},
|
||||
"parameters": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
|
@ -14,8 +18,10 @@
|
|||
"westus",
|
||||
"eastus"
|
||||
],
|
||||
"minLength": 2,
|
||||
"maxLength": 2,
|
||||
"metadata":{
|
||||
"description":"Array of Azure deployment regions to deploy to."
|
||||
"description":"Array of Azure regions to deploy resources to."
|
||||
}
|
||||
},
|
||||
"APP_SECRET": {
|
||||
|
@ -184,9 +190,21 @@
|
|||
{
|
||||
"name": "WEBSITE_NODE_DEFAULT_VERSION",
|
||||
"value": "6.9.1"
|
||||
},
|
||||
{
|
||||
"name": "UserAppInsightsKey",
|
||||
"value": "[reference(resourceId('Microsoft.Insights/components/', concat(variables('appInsightsName'), copyIndex())), '2015-05-01').InstrumentationKey]"
|
||||
},
|
||||
{
|
||||
"name": "UserAppInsightsName",
|
||||
"value": "[concat(variables('appInsightsName'), copyIndex())]"
|
||||
},
|
||||
{ "name": "UserAppInsightsAppId",
|
||||
"value": "[reference(resourceId('Microsoft.Insights/components/', concat(variables('appInsightsName'), copyIndex())), '2015-05-01').AppId]"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"httpsOnly": "true"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
|
@ -269,7 +287,8 @@
|
|||
"*"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"httpsOnly": "true"
|
||||
},
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Web/serverfarms/', concat(variables('appServicePlanName'), copyIndex()))]"
|
||||
|
@ -309,14 +328,14 @@
|
|||
"location": "global",
|
||||
"properties": {
|
||||
"profileStatus": "Enabled",
|
||||
"trafficRoutingMethod": "Priority",
|
||||
"trafficRoutingMethod": "Performance",
|
||||
"dnsConfig": {
|
||||
"relativeName": "[variables('trafficManagerDnsName')]",
|
||||
"ttl": 30
|
||||
},
|
||||
"monitorConfig": {
|
||||
"protocol": "HTTP",
|
||||
"port": 80,
|
||||
"protocol": "HTTPS",
|
||||
"port": 443,
|
||||
"path": "/"
|
||||
}
|
||||
}
|
||||
|
@ -336,6 +355,7 @@
|
|||
},
|
||||
"properties": {
|
||||
"targetResourceId": "[resourceId('Microsoft.Web/sites/', concat(variables('webAppClientName'), copyIndex()))]",
|
||||
"endpointLocation": "[parameters('locations')[copyIndex()]]",
|
||||
"endpointStatus": "Enabled"
|
||||
}
|
||||
},
|
||||
|
@ -346,14 +366,14 @@
|
|||
"location": "global",
|
||||
"properties": {
|
||||
"profileStatus": "Enabled",
|
||||
"trafficRoutingMethod": "Priority",
|
||||
"trafficRoutingMethod": "Weighted",
|
||||
"dnsConfig": {
|
||||
"relativeName": "[variables('qnaTrafficManagerDnsName')]",
|
||||
"ttl": 30
|
||||
},
|
||||
"monitorConfig": {
|
||||
"protocol": "HTTP",
|
||||
"port": 80,
|
||||
"protocol": "HTTPS",
|
||||
"port": 443,
|
||||
"path": "/"
|
||||
}
|
||||
}
|
||||
|
@ -373,6 +393,7 @@
|
|||
},
|
||||
"properties": {
|
||||
"targetResourceId": "[resourceId('Microsoft.Web/sites/', concat(variables('qnaMakerWebAppName'), copyIndex()))]",
|
||||
"weight": 1,
|
||||
"endpointStatus": "Enabled"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -0,0 +1,206 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"metadata" : {
|
||||
"comments": "This ARM template deploys Azure resources included in the Health Bot Reference Architecture",
|
||||
"author": "Microsoft Healthcare CSU"
|
||||
},
|
||||
"parameters": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"metadata":{
|
||||
"description":"Base name (prefix) for all resources."
|
||||
}
|
||||
},
|
||||
"locations": {
|
||||
"type": "array",
|
||||
"defaultValue": [
|
||||
"westus",
|
||||
"eastus"
|
||||
],
|
||||
"metadata":{
|
||||
"description":"Array of Azure deployment regions to deploy to."
|
||||
}
|
||||
},
|
||||
"tmDomainSuffix": {
|
||||
"type": "string",
|
||||
"defaultValue": ".trafficmanager.net",
|
||||
"metadata":{
|
||||
"description":"Azure Traffic Manager DNS suffix"
|
||||
}
|
||||
}
|
||||
},
|
||||
"variables": {
|
||||
"appServicePlanName": "[concat(parameters('name'), '-appServicePlan')]",
|
||||
"webAppClientName": "[concat(parameters('name'), '-webClient')]",
|
||||
"customDomainWebAppSvc": "[concat(parameters('name'), '-webclient', parameters('tmDomainSuffix'))]",
|
||||
"qnaMakerWebAppName": "[replace(concat(parameters('name'), '-qnahost'), '_', '')]",
|
||||
"customDomainQnaAppSvc": "[concat(parameters('name'), '-qna', parameters('tmDomainSuffix'))]"
|
||||
},
|
||||
"resources": [
|
||||
{
|
||||
"type": "Microsoft.Web/sites/hostnameBindings",
|
||||
"apiVersion": "2019-08-01",
|
||||
"name": "[concat(variables('webAppClientName'), copyIndex(), '/', variables('customDomainWebAppSvc'))]",
|
||||
"location": "[parameters('locations')[copyIndex()]]",
|
||||
"properties": {
|
||||
},
|
||||
"copy": {
|
||||
"name": "locationLoop",
|
||||
"count": "[length(parameters('locations'))]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Web/certificates",
|
||||
"apiVersion": "2019-08-01",
|
||||
"name": "[concat(variables('webAppClientName'), copyIndex())]",
|
||||
"location": "[parameters('locations')[copyIndex()]]",
|
||||
"properties": {
|
||||
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', concat(variables('appServicePlanName'), copyIndex()))]",
|
||||
"canonicalName": "[variables('customDomainWebAppSvc')]"
|
||||
},
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Web/sites/', concat(variables('webAppClientName'), copyIndex(), '/hostnameBindings/', variables('customDomainWebAppSvc')))]"
|
||||
],
|
||||
"copy": {
|
||||
"name": "locationLoop",
|
||||
"count": "[length(parameters('locations'))]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2017-05-10",
|
||||
"name": "nestedTemplate",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"template": {
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"resources": [
|
||||
{
|
||||
"type": "Microsoft.Web/sites/hostnameBindings",
|
||||
"name": "[concat(variables('webAppClientName'),'0','/',variables('customDomainWebAppSvc'))]",
|
||||
"apiVersion": "2019-08-01",
|
||||
"location": "[parameters('locations')[0]]",
|
||||
"properties": {
|
||||
"sslState": "SniEnabled",
|
||||
"thumbprint": "[reference(resourceId('Microsoft.Web/certificates', concat(variables('webAppClientName'), '0'))).Thumbprint]"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2017-05-10",
|
||||
"name": "nestedTemplate0",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"template": {
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"resources": [
|
||||
{
|
||||
"type": "Microsoft.Web/sites/hostnameBindings",
|
||||
"name": "[concat(variables('webAppClientName'),'1','/',variables('customDomainWebAppSvc'))]",
|
||||
"apiVersion": "2019-08-01",
|
||||
"location": "[parameters('locations')[1]]",
|
||||
"properties": {
|
||||
"sslState": "SniEnabled",
|
||||
"thumbprint": "[reference(resourceId('Microsoft.Web/certificates', concat(variables('webAppClientName'), '1'))).Thumbprint]"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Web/sites/hostnameBindings",
|
||||
"apiVersion": "2019-08-01",
|
||||
"name": "[concat(variables('qnaMakerWebAppName'), copyIndex(), '/', variables('customDomainQnaAppSvc'))]",
|
||||
"location": "[parameters('locations')[copyIndex()]]",
|
||||
"properties": {
|
||||
},
|
||||
"copy": {
|
||||
"name": "locationLoop",
|
||||
"count": "[length(parameters('locations'))]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "Microsoft.Web/certificates",
|
||||
"apiVersion": "2019-08-01",
|
||||
"name": "[concat(variables('qnaMakerWebAppName'), copyIndex())]",
|
||||
"location": "[parameters('locations')[copyIndex()]]",
|
||||
"properties": {
|
||||
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', concat(variables('appServicePlanName'), copyIndex()))]",
|
||||
"canonicalName": "[variables('customDomainQnaAppSvc')]"
|
||||
},
|
||||
"dependsOn": [
|
||||
"[concat('Microsoft.Web/sites/', concat(variables('qnaMakerWebAppName'), copyIndex(), '/hostnameBindings/', variables('customDomainQnaAppSvc')))]"
|
||||
],
|
||||
"copy": {
|
||||
"name": "locationLoop",
|
||||
"count": "[length(parameters('locations'))]"
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2017-05-10",
|
||||
"name": "nestedTemplate1",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"template": {
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"resources": [
|
||||
{
|
||||
"type": "Microsoft.Web/sites/hostnameBindings",
|
||||
"name": "[concat(variables('qnaMakerWebAppName'),'0','/',variables('customDomainQnaAppSvc'))]",
|
||||
"apiVersion": "2019-08-01",
|
||||
"location": "[parameters('locations')[0]]",
|
||||
"properties": {
|
||||
"sslState": "SniEnabled",
|
||||
"thumbprint": "[reference(resourceId('Microsoft.Web/certificates', concat(variables('qnaMakerWebAppName'), '0'))).Thumbprint]"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"apiVersion": "2017-05-10",
|
||||
"name": "nestedTemplate2",
|
||||
"type": "Microsoft.Resources/deployments",
|
||||
"properties": {
|
||||
"mode": "Incremental",
|
||||
"template": {
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"resources": [
|
||||
{
|
||||
"type": "Microsoft.Web/sites/hostnameBindings",
|
||||
"name": "[concat(variables('qnaMakerWebAppName'),'1','/',variables('customDomainQnaAppSvc'))]",
|
||||
"apiVersion": "2019-08-01",
|
||||
"location": "[parameters('locations')[1]]",
|
||||
"properties": {
|
||||
"sslState": "SniEnabled",
|
||||
"thumbprint": "[reference(resourceId('Microsoft.Web/certificates', concat(variables('qnaMakerWebAppName'), '1'))).Thumbprint]"
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"outputs": {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
|
||||
"contentVersion": "1.0.0.0",
|
||||
"parameters": {
|
||||
"name": {
|
||||
"value": "grtst04"
|
||||
},
|
||||
"locations": {
|
||||
"value": ["westus","westus2"]
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче