-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeployment-template.json
126 lines (125 loc) · 4.63 KB
/
deployment-template.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
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"AzureFunctionName": {
"type": "string",
"metadata": {
"description": "Azure Function name - must be globally unique"
}
},
"ApplicationInsightsName": {
"type": "string",
"metadata": {
"description": "Application Insights instance name."
}
},
"StorageAccountName": {
"type": "string",
"maxLength": 24,
"metadata": {
"description": "Storage account name (must be globally unique, max 24 characters)."
}
},
"NewOrExistingStorageAccount": {
"type": "string",
"allowedValues": [
"new",
"existing"
]
},
"StorageAccountType": {
"type": "string",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
"Standard_RAGRS"
],
"metadata": {
"description": "Storage Account type"
}
},
"TeamsWebhookURL": {
"type": "string",
"metadata": {
"description": "Microsoft Teams channel webhook URL."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
}
},
"variables": {
"sa-name": "[parameters('StorageAccountName')]",
"storageAccountid": "[resourceId('Microsoft.Storage/storageAccounts', parameters('StorageAccountName'))]"
},
"resources": [
{
"condition": "[equals(parameters('NewOrExistingStorageAccount'),'new')]",
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('sa-name')]",
"apiVersion": "2019-04-01",
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "[parameters('storageAccountType')]"
}
},
{
"apiVersion": "2015-05-01",
"name": "[parameters('ApplicationInsightsName')]",
"type": "Microsoft.Insights/components",
"kind": "web",
"location": "[resourceGroup().location]",
"tags": {
"[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', parameters('AzureFunctionName'))]": "Resource"
},
"properties": {
"Application_Type": "web",
"ApplicationId": "[parameters('ApplicationInsightsName')]"
}
},
{
"apiVersion": "2015-08-01",
"type": "Microsoft.Web/sites",
"kind": "functionapp,linux",
"name": "[parameters('AzureFunctionName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('StorageAccountName'))]",
"[resourceId('Microsoft.Insights/components', parameters('ApplicationInsightsName'))]"
],
"properties": {
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('StorageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "python"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~3"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('microsoft.insights/components/', parameters('ApplicationInsightsName')), '2015-05-01').InstrumentationKey]"
},
{
"name": "TEAMS_WEBHOOK_URL",
"value": "[parameters('TeamsWebhookURL')]"
}
]
},
"reserved": true
}
}
]
}