-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathazuredeploy.json
249 lines (249 loc) · 9.98 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
{
"$schema": "http://schemas.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"type": "string",
"metadata": {
"description": "Used to name the different components of the Serverless Request Bin. I.e. the Function App, the consumption plan, Application Insights and the Azure Storage account."
}
},
"appInsightsRegion": {
"type": "string",
"allowedValues": [
"eastus",
"eastus2",
"southcentralus",
"westus",
"westus2",
"centralus",
"southafricanorth",
"australiaeast",
"southeastasia",
"centralindia",
"eastasia",
"japaneast",
"koreacentral",
"canadacentral",
"northeurope",
"uksouth",
"westeurope",
"francecentral"
],
"metadata": {
"description": "Given that App Insights is not available in all regions, choose the closest region to the resource group. "
}
},
"requestBinProvider": {
"type": "string",
"defaultValue": "Memory",
"allowedValues": [
"Memory"
],
"metadata": {
"description": "App Setting to configure the Request Bin Provider to store the request history."
}
},
"requestBinRenderer": {
"type": "string",
"defaultValue": "Liquid",
"allowedValues": [
"Liquid"
],
"metadata": {
"description": "App Setting to configure the Request Bin Renderer to return request bin history to the user."
}
},
"RequestBinRendererTemplate": {
"type": "string",
"defaultValue": "DarkHtmlRender.liquid",
"metadata": {
"description": "File name of the Liquid template to use while rendering the request bin history"
}
},
"requestBinMaxSize": {
"type": "int",
"defaultValue": 20,
"metadata": {
"description": "Max number of request to store in the Request Bin"
}
},
"requestBodyMaxLength": {
"type": "int",
"defaultValue": 128000,
"metadata": {
"description": "Max number of characters to read and store of a request body. If a request body is larger than this limit, the body will be truncated."
}
},
"requestBinSlidingExpiration": {
"type": "int",
"defaultValue": 180,
"metadata": {
"description": "For the 'Memory' (cache) Provider, the sliding expiration time in minutes. This setting is to configure the In-memory cache, however, the Function App host can be replaced or recycled at any time by the platform."
}
},
"requestBinAbsoluteExpiration": {
"type": "int",
"defaultValue": 720,
"metadata": {
"description": "For the 'Memory' (cache) Provider, the absolute expiration time in minutes. This setting is to configure the In-memory cache, however, the Function App host can be replaced or recycled at any time by the platform."
}
}
},
"variables": {
"functionAppName": "[concat(parameters('appName'), '-func')]",
"hostingPlanName": "[concat(parameters('appName'), '-plan')]",
"applicationInsightsName": "[concat(parameters('appName'), '-appins')]",
"repoURL": "https://github.com/pacodelacruz/serverless-request-bin-azure-functions.git",
"branch": "master",
"storageAccountPrefix": "[if(greaterOrEquals(length(parameters('appName')), 9), substring(parameters('appName'), 0, 9), substring(parameters('appName'), 0, length(parameters('appName'))))]",
"storageAccountName": "[concat(variables('storageAccountPrefix'), 'st', uniquestring(resourceGroup().id))]",
"storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"apiVersion": "2018-07-01",
"kind": "StorageV2",
"location": "[resourceGroup().location]",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"accessTier": "Hot"
}
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2016-09-01",
"name": "[variables('hostingPlanName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "Y1",
"tier": "Dynamic",
"size": "Y1",
"family": "Y",
"capacity": 0
},
"kind": "functionapp",
"properties": {
"perSiteScaling": false,
"reserved": false,
"targetWorkerCount": 0,
"targetWorkerSizeId": 0
}
},
{
"type": "microsoft.insights/components",
"name": "[variables('applicationInsightsName')]",
"apiVersion": "2015-05-01",
"location": "[parameters('appInsightsRegion')]",
"tags": {
"[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('applicationInsightsName'))]": "Resource"
},
"properties": {
"ApplicationId": "[variables('applicationInsightsName')]",
"Request_Source": "IbizaWebAppExtensionCreate"
}
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2016-08-01",
"name": "[variables('functionAppName')]",
"location": "[resourceGroup().location]",
"kind": "functionapp",
"properties": {
"name": "[variables('functionAppName')]",
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"hostingEnvironment": "",
"clientAffinityEnabled": false,
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsDashboard",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
},
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower(variables('functionAppName'))]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~2"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "dotnet"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('Microsoft.Insights/components', variables('applicationInsightsName')), '2015-05-01').InstrumentationKey]"
},
{
"name": "WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT",
"value": "1"
},
{
"name": "RequestBinProvider",
"value": "[parameters('requestBinProvider')]"
},
{
"name": "RequestBinRenderer",
"value": "[parameters('RequestBinRenderer')]"
},
{
"name": "RequestBinRendererTemplate",
"value": "[parameters('RequestBinRendererTemplate')]"
},
{
"name": "RequestBinMaxSize",
"value": "[int(parameters('RequestBinMaxSize'))]"
},
{
"name": "RequestBodyMaxLength",
"value": "[int(parameters('RequestBodyMaxLength'))]"
},
{
"name": "RequestBinSlidingExpiration",
"value": "[int(parameters('RequestBinSlidingExpiration'))]"
},
{
"name": "RequestBinAbsoluteExpiration",
"value": "[int(parameters('RequestBinAbsoluteExpiration'))]"
}
]
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]",
"[resourceId('microsoft.insights/components', variables('applicationInsightsName'))]"
],
"resources": [
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('functionAppName'))]"
],
"properties": {
"RepoUrl": "[variables('repoURL')]",
"branch": "[variables('branch')]",
"IsManualIntegration": true
}
}
]
}
]
}