This repository has been archived by the owner on May 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
azuredeploy.json
504 lines (504 loc) · 31.4 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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appRegistrationClientId": {
"type": "string",
"defaultValue": "dc0fcdd9-727f-47a3-8f15-4dcb813919fc"
},
"appRegistrationApiURI": {
"type": "string",
"defaultValue": "api://10ef1e6b-1171-4888-92d5-c661b428796b"
},
"userEmailAddress": {
"type": "string",
"defaultValue": "user@microsoft.com"
},
"userObjectId": {
"type": "string",
"defaultValue": ""
}
},
"variables": {
"uniqueIdentifier": "[substring(uniqueString(subscription().subscriptionId, resourceGroup().id),0,9)]",
"functionList": [
"connect",
"assignments",
"learncontent",
"links",
"platforms",
"users"
],
"enabledForDeployment": false,
"enabledForDiskEncryption": false,
"enabledForTemplateDeployment": false,
"tenantId": "[subscription().tenantId]",
"skuName": "Standard",
"location": "[resourceGroup().location]",
"runtimeStack": "dotnet",
"resourceGroupName": "[resourceGroup().name]",
"StorageAccountSuffix": "[toLower(replace(variables('uniqueIdentifier'),'-',''))]",
"ProjectNameSuffix": "[concat('-', variables('StorageAccountSuffix'))]",
"staticWebsite": "[toLower(concat('learnclient', variables('StorageAccountSuffix')))]",
"keyVaultName": "[toLower(concat('kv', variables('ProjectNameSuffix')))]",
"KeyVaultAuditLogsStorageAccountName": "[toLower(concat('kv' , variables('StorageAccountSuffix'), 'auditlogs'))]",
"readerRoleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/', 'acdd72a7-3385-48ef-bd42-f606fba81ae7')]",
"KVKeyPermissions": [
"encrypt",
"decrypt",
"wrapKey",
"unwrapKey",
"sign",
"verify",
"get"
]
},
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2019-08-01",
"name": "[concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('ProjectNameSuffix'))]",
"location": "[variables('location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('ProjectNameSuffix')))]",
"[resourceId('Microsoft.Storage/storageAccounts', concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('StorageAccountSuffix')))]",
"[resourceId('microsoft.insights/components', concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('ProjectNameSuffix')))]"
],
"kind": "functionapp",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"httpsOnly": true,
"siteConfig": {
"appSettings": [
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "[variables('runtimeStack')]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=',concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('StorageAccountSuffix')), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('StorageAccountSuffix'))), '2019-06-01').keys[0].value)]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~3"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('microsoft.insights/components', concat(variables('functionList')[copyIndex('FunctionatIndex')] , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('StorageAccountSuffix')), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('StorageAccountSuffix'))),'2019-06-01').keys[0].value)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower(concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('ProjectNameSuffix')))]"
},
{
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
"value": "[concat('InstrumentationKey=',reference(resourceId('microsoft.insights/components', concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey)]"
},
{
"name": "WEBSITE_ENABLE_SYNC_UPDATE_SITE",
"value": "true"
},
{
"name": "WEBSITE_RUN_FROM_PACKAGE",
"value": "1"
}
],
"cors": {
"allowedOrigins": [
"[substring(reference(resourceId('Microsoft.Storage/storageAccounts/', variables('staticWebsite'))).primaryEndpoints.web,0,sub(length(reference(resourceId('Microsoft.Storage/storageAccounts/', variables('staticWebsite'))).primaryEndpoints.web),1))]"
]
},
"ftpsState": "Disabled",
"minTlsVersion": "1.2"
},
"name": "[concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('ProjectNameSuffix'))]",
"clientAffinityEnabled": false,
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms/',concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('ProjectNameSuffix')))]"
},
"copy": {
"name": "FunctionatIndex",
"count": "[length(variables('functionList'))]"
}
},
{
"name": "[concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('ProjectNameSuffix'),'/authsettings')]",
"apiVersion": "2018-11-01",
"type": "Microsoft.Web/sites/config",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('ProjectNameSuffix')))]"
],
"properties": {
"enabled": "[if(equals(concat(variables('functionList')[copyIndex('FunctionatIndex')], variables('ProjectNameSuffix')),concat('connect', variables('ProjectNameSuffix'))), 'false', 'true')]",
"unauthenticatedClientAction": "RedirectToLoginPage",
"tokenStoreEnabled": true,
"defaultProvider": "AzureActiveDirectory",
"clientId": "[parameters('appRegistrationClientId')]",
"issuer": "[concat('https://sts.windows.net/', variables('tenantId'), '/')]",
"allowedAudiences": [
"[parameters('appRegistrationApiURI')]"
]
},
"copy": {
"name": "FunctionatIndex",
"count": "[length(variables('functionList'))]"
}
},
{
"name": "[concat('connect', variables('ProjectNameSuffix'), '/appsettings')]",
"apiVersion": "2018-11-01",
"type": "Microsoft.Web/sites/config",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', concat('connect' , variables('ProjectNameSuffix')))]"
],
"properties": {
"AuthUrl": "[parameters('appRegistrationApiURI')]",
"AssignmentsServiceUrl": "[concat('https://', 'assignments' , variables('ProjectNameSuffix'), '.azurewebsites.net/api/')]",
"Lti1Secret": "LearnLTI",
"PlatformsServiceUrl": "[concat('https://', 'platforms', variables('ProjectNameSuffix'), '.azurewebsites.net/api/')]",
"RedirectUrl": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('staticWebsite'))).primaryEndpoints.web]",
"FUNCTIONS_WORKER_RUNTIME": "[variables('runtimeStack')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=',concat('connect' , variables('StorageAccountSuffix') ), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('connect' , variables('StorageAccountSuffix'))), '2019-06-01').keys[0].value)]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('microsoft.insights/components', concat('connect' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey]",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', concat('connect' , variables('StorageAccountSuffix')), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('connect' , variables('StorageAccountSuffix'))),'2019-06-01').keys[0].value)]",
"WEBSITE_CONTENTSHARE": "[toLower(concat('connect' , variables('ProjectNameSuffix')))]",
"APPLICATIONINSIGHTS_CONNECTION_STRING": "[concat('InstrumentationKey=',reference(resourceId('microsoft.insights/components', concat('connect' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey)]",
"WEBSITE_ENABLE_SYNC_UPDATE_SITE": "true",
"WEBSITE_RUN_FROM_PACKAGE": "1"
}
},
{
"name": "[concat('users', variables('ProjectNameSuffix'), '/appsettings')]",
"apiVersion": "2018-11-01",
"type": "Microsoft.Web/sites/config",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', concat('users', variables('ProjectNameSuffix')))]"
],
"properties": {
"AuthUrl": "[parameters('appRegistrationApiURI')]",
"AssignmentsServiceUrl": "[concat('https://', 'assignments', variables('ProjectNameSuffix'), '.azurewebsites.net/api/')]",
"Lti1Secret": "LearnLTI",
"PlatformsServiceUrl": "[concat('https://', 'platforms', variables('ProjectNameSuffix'), '.azurewebsites.net/api/')]",
"FUNCTIONS_WORKER_RUNTIME": "[variables('runtimeStack')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=',concat('users' , variables('StorageAccountSuffix') ), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('users' , variables('StorageAccountSuffix'))), '2019-06-01').keys[0].value)]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('microsoft.insights/components', concat('users' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey]",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', concat('users' , variables('StorageAccountSuffix')), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('users' , variables('StorageAccountSuffix'))),'2019-06-01').keys[0].value)]",
"WEBSITE_CONTENTSHARE": "[toLower(concat('users' , variables('ProjectNameSuffix')))]",
"APPLICATIONINSIGHTS_CONNECTION_STRING": "[concat('InstrumentationKey=',reference(resourceId('microsoft.insights/components', concat('users' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey)]",
"WEBSITE_ENABLE_SYNC_UPDATE_SITE": "true",
"WEBSITE_RUN_FROM_PACKAGE": "1"
}
},
{
"name": "[concat('assignments' , variables('ProjectNameSuffix'), '/appsettings')]",
"apiVersion": "2018-11-01",
"type": "Microsoft.Web/sites/config",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', concat('assignments' , variables('ProjectNameSuffix')))]"
],
"properties": {
"AuthUrl": "[parameters('appRegistrationApiURI')]",
"PlatformsServiceUrl": "[concat('https://','platforms' , variables('ProjectNameSuffix'),'.azurewebsites.net/api/')]",
"UsersServiceUrl": "[concat('https://','users' , variables('ProjectNameSuffix'),'.azurewebsites.net/api/')]",
"FUNCTIONS_WORKER_RUNTIME": "[variables('runtimeStack')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=',concat('assignments' , variables('StorageAccountSuffix') ), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('assignments' , variables('StorageAccountSuffix'))), '2019-06-01').keys[0].value)]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('microsoft.insights/components', concat('assignments' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey]",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', concat('assignments' , variables('StorageAccountSuffix')), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('assignments' , variables('StorageAccountSuffix'))),'2019-06-01').keys[0].value)]",
"WEBSITE_CONTENTSHARE": "[toLower(concat('assignments' , variables('ProjectNameSuffix')))]",
"APPLICATIONINSIGHTS_CONNECTION_STRING": "[concat('InstrumentationKey=',reference(resourceId('microsoft.insights/components', concat('assignments' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey)]",
"WEBSITE_ENABLE_SYNC_UPDATE_SITE": "true",
"WEBSITE_RUN_FROM_PACKAGE": "1"
}
},
{
"name": "[concat('platforms' , variables('ProjectNameSuffix'),'/appsettings')]",
"apiVersion": "2018-11-01",
"type": "Microsoft.Web/sites/config",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', concat('platforms' , variables('ProjectNameSuffix')))]"
],
"properties": {
"AllowedUsers": "[parameters('userEmailAddress')]",
"AuthUrl": "[parameters('appRegistrationApiURI')]",
"ConnectApiBaseUrl": "[concat('https://','connect' , variables('ProjectNameSuffix'),'.azurewebsites.net/api/')]",
"FUNCTIONS_WORKER_RUNTIME": "[variables('runtimeStack')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=',concat('platforms' , variables('StorageAccountSuffix') ), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('platforms' , variables('StorageAccountSuffix'))), '2019-06-01').keys[0].value)]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('microsoft.insights/components', concat('platforms' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey]",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', concat('platforms' , variables('StorageAccountSuffix')), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('platforms' , variables('StorageAccountSuffix'))),'2019-06-01').keys[0].value)]",
"WEBSITE_CONTENTSHARE": "[toLower(concat('platforms' , variables('ProjectNameSuffix')))]",
"APPLICATIONINSIGHTS_CONNECTION_STRING": "[concat('InstrumentationKey=',reference(resourceId('microsoft.insights/components', concat('platforms' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey)]",
"WEBSITE_ENABLE_SYNC_UPDATE_SITE": "true",
"WEBSITE_RUN_FROM_PACKAGE": "1"
}
},
{
"name": "[concat('links', variables('ProjectNameSuffix'), '/appsettings')]",
"apiVersion": "2018-11-01",
"type": "Microsoft.Web/sites/config",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', concat('links' , variables('ProjectNameSuffix')))]"
],
"properties": {
"AuthUrl": "[parameters('appRegistrationApiURI')]",
"UsersServiceUrl": "[concat('https://','users' , variables('ProjectNameSuffix'),'.azurewebsites.net/api/')]",
"FUNCTIONS_WORKER_RUNTIME": "[variables('runtimeStack')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=',concat('links' , variables('StorageAccountSuffix') ), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('links' , variables('StorageAccountSuffix'))), '2019-06-01').keys[0].value)]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('microsoft.insights/components', concat('links' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey]",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', concat('links' , variables('StorageAccountSuffix')), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('links' , variables('StorageAccountSuffix'))),'2019-06-01').keys[0].value)]",
"WEBSITE_CONTENTSHARE": "[toLower(concat('links' , variables('ProjectNameSuffix')))]",
"APPLICATIONINSIGHTS_CONNECTION_STRING": "[concat('InstrumentationKey=',reference(resourceId('microsoft.insights/components', concat('links' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey)]",
"WEBSITE_ENABLE_SYNC_UPDATE_SITE": "true",
"WEBSITE_RUN_FROM_PACKAGE": "1"
}
},
{
"name": "[concat('learncontent', variables('ProjectNameSuffix'), '/appsettings')]",
"apiVersion": "2018-11-01",
"type": "Microsoft.Web/sites/config",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', concat('learncontent' , variables('ProjectNameSuffix')))]"
],
"properties": {
"AuthUrl": "[parameters('appRegistrationApiURI')]",
"UsersServiceUrl": "[concat('https://','users' , variables('ProjectNameSuffix'),'.azurewebsites.net/api/')]",
"FUNCTIONS_WORKER_RUNTIME": "[variables('runtimeStack')]",
"AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=',concat('learncontent' , variables('StorageAccountSuffix') ), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=',listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('learncontent' , variables('StorageAccountSuffix'))), '2019-06-01').keys[0].value)]",
"FUNCTIONS_EXTENSION_VERSION": "~3",
"APPINSIGHTS_INSTRUMENTATIONKEY": "[reference(resourceId('microsoft.insights/components', concat('learncontent' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey]",
"WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', concat('learncontent' , variables('StorageAccountSuffix')), ';EndpointSuffix=', environment().suffixes.storage, ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', concat('learncontent' , variables('StorageAccountSuffix'))),'2019-06-01').keys[0].value)]",
"WEBSITE_CONTENTSHARE": "[toLower(concat('learncontent' , variables('ProjectNameSuffix')))]",
"APPLICATIONINSIGHTS_CONNECTION_STRING": "[concat('InstrumentationKey=',reference(resourceId('microsoft.insights/components', concat('learncontent' , variables('ProjectNameSuffix'))), '2018-05-01-preview').InstrumentationKey)]",
"WEBSITE_ENABLE_SYNC_UPDATE_SITE": "true",
"WEBSITE_RUN_FROM_PACKAGE": "1"
}
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2019-08-01",
"name": "[concat(variables('functionList')[copyIndex('FunctionatIndex')] , variables('ProjectNameSuffix'))]",
"location": "[variables('location')]",
"sku": {
"name": "Y1",
"tier": "Dynamic",
"size": "Y1",
"family": "Y",
"capacity": 0
},
"properties": {
"name": "[concat(variables('functionList')[copyIndex('FunctionatIndex')] , variables('ProjectNameSuffix'))]"
},
"copy": {
"name": "FunctionatIndex",
"count": "[length(variables('functionList'))]"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-04-01",
"name": "[variables('staticWebsite')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "StorageV2"
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[concat(variables('functionList')[copyIndex('FunctionatIndex')] , variables('StorageAccountSuffix'))]",
"location": "[variables('location')]",
"sku": {
"name": "Standard_LRS"
},
"copy": {
"name": "FunctionatIndex",
"count": "[length(variables('functionList'))]"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[variables('KeyVaultAuditLogsStorageAccountName')]",
"location": "[variables('location')]",
"sku": {
"name": "Standard_LRS"
}
},
{
"type": "Microsoft.Insights/components",
"apiVersion": "2018-05-01-preview",
"name": "[concat(variables('functionList')[copyIndex('FunctionatIndex')] , variables('ProjectNameSuffix'))]",
"location": "[variables('location')]",
"tags": {
"[concat('hidden-link:', resourceId('Microsoft.Web/sites/',concat(variables('functionList')[copyIndex('FunctionatIndex')] , variables('ProjectNameSuffix')) ))]": "Resource"
},
"properties": {
"ApplicationId": "[concat(variables('functionList')[copyIndex('FunctionatIndex')] , variables('ProjectNameSuffix'))]"
},
"copy": {
"name": "FunctionatIndex",
"count": "[length(variables('functionList'))]"
}
},
{
"type": "Microsoft.KeyVault/vaults",
"name": "[variables('keyVaultName')]",
"apiVersion": "2018-02-14",
"location": "[variables('location')]",
"properties": {
"enabledForDeployment": "[variables('enabledForDeployment')]",
"enabledForDiskEncryption": "[variables('enabledForDiskEncryption')]",
"enabledForTemplateDeployment": "[variables('enabledForTemplateDeployment')]",
"enableSoftDelete": true,
"enablePurgeProtection": true,
"tenantId": "[variables('tenantId')]",
"accessPolicies": [
{
"objectId": "[parameters('userObjectId')]",
"tenantId": "[variables('tenantId')]",
"permissions": {
"keys": [
"All"
],
"secrets": [
"All"
]
}
}
],
"sku": {
"name": "[variables('skuName')]",
"family": "A"
},
"networkAcls": {
"defaultAction": "Allow",
"bypass": "AzureServices"
}
}
},
{
"type": "Microsoft.KeyVault/vaults/providers/diagnosticSettings",
"apiVersion": "2017-05-01-preview",
"name": "[concat(variables('keyVaultName'), '/Microsoft.Insights/Send to all locations')]",
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('KeyVaultAuditLogsStorageAccountName'))]"
],
"properties": {
"storageAccountId": "[concat( '/subscriptions/', subscription().subscriptionId, '/resourceGroups/', variables('resourceGroupName'), '/providers/Microsoft.Storage/storageAccounts/', variables('KeyVaultAuditLogsStorageAccountName'))]",
"logs": [
{
"category": "AuditEvent",
"enabled": true,
"RetentionEnabled": true,
"RetentionInDays": 90
}
]
}
},
{
"type": "Microsoft.KeyVault/vaults/accessPolicies",
"name": "[concat(variables('keyVaultName'), '/add')]",
"apiVersion": "2019-09-01",
"properties": {
"accessPolicies": [
{
"tenantId": "[variables('tenantId')]",
"objectId": "[reference(resourceId('Microsoft.Web/sites',concat('connect' , variables('ProjectNameSuffix'))), '2019-08-01', 'Full').identity.principalId]",
"permissions": {
"keys": "[variables('KVKeyPermissions')]"
}
},
{
"tenantId": "[variables('tenantId')]",
"objectId": "[reference(resourceId('Microsoft.Web/sites',concat('users' , variables('ProjectNameSuffix'))), '2019-08-01', 'Full').identity.principalId]",
"permissions": {
"keys": "[variables('KVKeyPermissions')]"
}
},
{
"tenantId": "[variables('tenantId')]",
"objectId": "[reference(resourceId('Microsoft.Web/sites',concat('platforms' , variables('ProjectNameSuffix'))), '2019-08-01', 'Full').identity.principalId]",
"permissions": {
"keys": "[variables('KVKeyPermissions')]"
}
}
]
}
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2018-09-01-preview",
"name": "[guid(concat(resourceGroup().id, variables('functionList')[copyIndex('FunctionatIndex')] , variables('ProjectNameSuffix')))]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites',concat(variables('functionList')[copyIndex('FunctionatIndex')] , variables('ProjectNameSuffix')))]"
],
"properties": {
"roleDefinitionId": "[variables('readerRoleDefinitionId')]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', concat(variables('functionList')[copyIndex('FunctionatIndex')] , variables('ProjectNameSuffix'))), '2019-08-01', 'full').identity.principalId]",
"scope": "[resourceGroup().id]",
"principalType": "ServicePrincipal"
},
"copy": {
"name": "FunctionatIndex",
"count": "[length(variables('functionList'))]"
}
}
],
"outputs": {
"WebClientURL": {
"value": "[reference(resourceId('Microsoft.Storage/storageAccounts/', variables('staticWebsite'))).primaryEndpoints.web]",
"type": "string"
},
"ConnectFunctionName": {
"value": "[concat('connect', variables('ProjectNameSuffix'))]",
"type": "string"
},
"PlatformsFunctionName": {
"value": "[concat('platforms', variables('ProjectNameSuffix'))]",
"type": "string"
},
"UsersFunctionName": {
"value": "[concat('users', variables('ProjectNameSuffix'))]",
"type": "string"
},
"KeyVaultName": {
"value": "[variables('keyVaultName')]",
"type": "string"
},
"LearnContentFunctionName": {
"value": "[concat('learncontent', variables('ProjectNameSuffix'))]",
"type": "string"
},
"AssignmentsFunctionName": {
"value": "[concat('assignments', variables('ProjectNameSuffix'))]",
"type": "string"
},
"LinksFunctionName": {
"value": "[concat('links', variables('ProjectNameSuffix'))]",
"type": "string"
},
"StaticWebSiteName": {
"value": "[variables('staticWebsite')]",
"type": "string"
}
}
}