-
Notifications
You must be signed in to change notification settings - Fork 76
/
azuredeploy.json
252 lines (251 loc) · 8.97 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appServicePlanName": {
"type": "string",
"minLength": 1
},
"appServicePlanSKU": {
"type": "string",
"allowedValues": [
"Free",
"Shared",
"Basic",
"Standard"
],
"defaultValue": "Standard"
},
"appServicePlanWorkerSize": {
"type": "string",
"allowedValues": [
"0",
"1",
"2"
],
"defaultValue": "0"
},
"storageType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_ZRS",
"Standard_GRS",
"Standard_RAGRS",
"Premium_LRS"
]
},
"webAppName": {
"type": "string",
"metadata": {
"description": "The azure web site name"
}
},
"tenant": {
"type": "string"
},
"clientId": {
"type": "string"
},
"clientSecret": { "type": "string" },
"hostnames": { "type": "string" },
"email": { "type": "string" },
"acmeUrl": {
"type": "string",
"defaultValue": "https://acme-v02.api.letsencrypt.org/directory",
"metadata": {
"description": "The url of the lets encrypt servers. Staging: (https://acme-staging-v02.api.letsencrypt.org/directory)"
}
},
"principalId": {
"type": "string",
"metadata": {
"description": "The principalid/objectid for service principal registered in Azure AD, can e.g. be found with Get-MsolServicePrincipal |? {$_.AppPrincipalId -eq \"<cliendId>\"}"
}
},
"authenticationEndpoint": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The authenticaion endpoint/azure active directory authority used in the selected azure region, when unset it defaults to https://login.windows.net/"
}
},
"tokenAudience": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The token audience/resourceId used in the selected azure region, when unset it defaults to https://management.core.windows.net/"
}
},
"managementEndpoint": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The Azure ARM management endpoint used in the selected azure region, when unset it defaults to https://management.azure.com"
}
},
"webSitesDefaultDomainName": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "The default azure web app domain name used in the selected azure region, when unset it defaults to azurewebsites.net"
}
},
"siteExtensionFeedUrl": {
"type": "string",
"defaultValue": "https://www.nuget.org/api/v2/",
"metadata": {
"description": "Url for the nuget feed to download site-extensions from, per default you don't need to change this. Used for overriding with private feed for testing prerelease versions"
}
},
"runFromPackage": {
"type": "string",
"defaultValue": "0",
"metadata": {
"description": "Set this to a url for a deployment package or 1 and dump a package in d:\\home\\data\\SitePackages, together with a packagename.txt file which contains the filename of the package in the folder"
}
}
},
"variables": {
"Owner": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', '8e3af657-a8ff-443c-a75c-2fe8c4bcb635')]",
"webAppName": "[parameters('webAppName')]",
"storageName": "[concat('storage', uniqueString(resourceGroup().id))]",
"scope": "[resourceGroup().id]"
},
"resources": [
{
"name": "[parameters('appServicePlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[resourceGroup().location]",
"apiVersion": "2014-06-01",
"dependsOn": [],
"tags": {
"displayName": "appServicePlan"
},
"properties": {
"name": "[parameters('appServicePlanName')]",
"sku": "[parameters('appServicePlanSKU')]",
"workerSize": "[parameters('appServicePlanWorkerSize')]",
"numberOfWorkers": 1
}
},
{
"name": "[variables('webAppName')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"apiVersion": "2015-08-01",
"dependsOn": [
"[concat('Microsoft.Web/serverfarms/', parameters('appServicePlanName'))]"
],
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('appServicePlanName'))]": "Resource",
"displayName": "webApp"
},
"properties": {
"name": "[variables('webAppName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', parameters('appServicePlanName'))]",
"siteConfig": {
"AlwaysOn": true
}
},
"resources": [
{
"apiVersion": "2015-08-01",
"name": "appsettings",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webAppName'))]"
],
"properties": {
"letsencrypt:Hostnames": "[parameters('hostnames')]",
"letsencrypt:Email": "[parameters('email')]",
"letsencrypt:AcmeBaseUri": "[parameters('acmeUrl')]",
"letsencrypt:SubscriptionId": "[subscription().subscriptionId]",
"letsencrypt:Tenant": "[parameters('tenant')]",
"letsencrypt:ClientId": "[parameters('clientId')]",
"letsencrypt:ClientSecret": "[parameters('clientSecret')]",
"letsencrypt:ResourceGroupName": "[resourceGroup().name]",
"letsencrypt:UseIPBasedSSL": "false",
"letsencrypt:AzureAuthenticationEndpoint": "[parameters('authenticationEndpoint')]",
"letsencrypt:AzureTokenAudience": "[parameters('tokenAudience')]",
"letsencrypt:AzureManagementEndpoint": "[parameters('managementEndpoint')]",
"letsencrypt:AzureDefaultWebSiteDomainName": "[parameters('webSitesDefaultDomainName')]",
"SCM_SITEEXTENSIONS_FEED_URL ": "[parameters('siteExtensionFeedUrl')]",
"WEBSITE_RUN_FROM_PACKAGE": "[parameters('runFromPackage')]"
}
},
{
"apiVersion": "2015-08-01",
"name": "letsencrypt",
"type": "siteextensions",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('webAppName'))]",
"[resourceId('Microsoft.Web/Sites/config', variables('webAppName'), 'appsettings')]",
"[resourceId('Microsoft.Web/Sites/config', variables('webAppName'), 'connectionstrings')]"
],
"properties": {
"test": "key1"
}
},
{
"apiVersion": "2014-11-01",
"type": "config",
"name": "connectionstrings",
"dependsOn": [ "[concat('Microsoft.Web/Sites/', variables('webAppName'))]" ],
"properties": {
"AzureWebJobsStorage": {
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), '2015-06-15').key1,';')]",
"type": 3
},
"AzureWebJobsDashboard": {
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), '2015-06-15').key1,';')]",
"type": 3
}
}
}
]
},
{
"name": "[variables('storageName')]",
"type": "Microsoft.Storage/storageAccounts",
"location": "[resourceGroup().location]",
"apiVersion": "2015-06-15",
"dependsOn": [],
"tags": {
"displayName": "storage"
},
"properties": {
"accountType": "[parameters('storageType')]"
}
},
{
"apiVersion": "2018-02-01",
"type": "Microsoft.Web/sites/hostNameBindings",
"name": "[concat(variables('webAppName'),'/', split(parameters('hostnames'), ',')[copyIndex()])]",
"dependsOn": [
"[concat('Microsoft.Web/sites/', variables('webAppName'))]"
],
"tags": {
"displayName": "hostNameBinding"
},
"properties": {
"domainId": null,
"hostNameType": "Verified",
"siteName": "variables('webAppName')"
},
"copy": {
"name": "hostnameloop",
"mode": "serial",
"batchSize": 1,
"count": "[length(split(parameters('hostnames'),','))]"
}
}
],
"outputs": {
"ConnectionString": {
"type": "string",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',variables('storageName'),';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageName')), '2015-06-15').key1,';')]"
}
}
}