forked from garvincasimir/azure-webapp-keyvault-ssl-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azuredeploy.json
128 lines (124 loc) · 4.34 KB
/
azuredeploy.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
{
"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion":"1.0.0.0",
"variables": {
"linkedTemplateBase": "[uri(deployment().properties.templateLink.uri, 'nestedtemplates')]"
},
"parameters":{
"certificateName":{
"type":"string",
"metadata":{
"description":"User friendly certificate resource name"
}
},
"existingKeyVaultId":{
"type":"string",
"metadata":{
"description":"Existing Key Vault resource Id with an access policy to allow Microsoft.Web RP to read Key Vault secrets (Checkout README.md for more information)"
}
},
"existingKeyVaultSecretName":{
"type":"string",
"metadata":{
"description":"Key Vault Secret that contains a PFX certificate"
}
},
"webAppName":{
"type":"string",
"metadata":{
"description":"App name to use for creating SSL binding. This App should have the hostname assigned as a custom domain"
}
},
"servicePlanName":{
"type":"string",
"metadata":{
"description":"Service Plan"
}
},
"hostname":{
"type":"string",
"metadata":{
"description":"Custom hostname for creating SSL binding. This hostname should already be assigned to the Web App"
}
}
},
"resources":[
{
"type": "Microsoft.Web/serverfarms",
"sku": {
"name": "S1",
"tier": "Standard",
"size": "S1",
"family": "S",
"capacity": 1
},
"name": "[parameters('servicePlanName')]",
"apiVersion": "2015-08-01",
"location":"[resourceGroup().location]",
"properties": {
"name": "[parameters('servicePlanName')]",
"numberOfWorkers": 1
}
},
{
"type":"Microsoft.Web/certificates",
"name":"[parameters('certificateName')]",
"apiVersion":"2016-03-01",
"location":"[resourceGroup().location]",
"properties":{
"keyVaultId":"[parameters('existingKeyVaultId')]",
"keyVaultSecretName":"[parameters('existingKeyVaultSecretName')]"
}
},
{
"type":"Microsoft.Web/sites",
"name":"[parameters('webAppName')]",
"apiVersion":"2016-03-01",
"location":"[resourceGroup().location]",
"dependsOn":[
"[resourceId('Microsoft.Web/serverfarms', parameters('servicePlanName'))]",
"[resourceId('Microsoft.Web/certificates', parameters('certificateName'))]"
],
"resources": [
{
"apiVersion": "2015-08-01",
"type": "hostNameBindings",
"name": "[parameters('hostname')]",
"dependsOn": [
"[concat('Microsoft.Web/sites/', parameters('webAppName'))]"
],
"properties": {
"siteName": "parameters('webAppName'))]",
"domainId": null,
"hostNameType": "Verified"
}
}
],
"properties":{
"name":"[parameters('webAppName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('servicePlanName'))]"
}
},
{
"apiVersion": "2015-01-01",
"name": "linkedTemplate",
"type": "Microsoft.Resources/deployments",
"dependsOn":[
"[concat('Microsoft.Web/sites/', parameters('webAppName'))]"
],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[concat(variables('linkedTemplateBase'),'/webapp-ssl-bind.json')]",
"contentVersion": "1.0.0.0"
},
"parameters": {
"existingWebAppName":{"value": "[parameters('webAppName')]"},
"hostname":{"value": "[parameters('hostname')]"},
"existingAppLocation":{"value": "[resourceGroup().location]"},
"certificateThumprint":{"value": "[reference(resourceId('Microsoft.Web/certificates', parameters('certificateName'))).Thumbprint]"}
}
}
}
]
}