-
Notifications
You must be signed in to change notification settings - Fork 2
/
azuredeploy.json
327 lines (327 loc) · 12 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
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"siteName": {
"type": "string"
},
"siteLocation": {
"type": "string",
"defaultValue": "centralus"
},
"deploymentMode": {
"type": "string",
"allowedValues": [
"standalone",
"frontendOnly"
], "defaultValue": "frontendOnly"
},
"sqlLogin": {
"type": "string",
"defaultValue": ""
},
"sqlPassword": {
"type": "securestring",
"defaultValue": ""
},
"enablePersonalizer": {
"type": "bool",
"defaultValue": false
},
"repoUrl": {
"type": "string",
"defaultValue": "https://github.com/microsoft/TailwindTraders-Website"
},
"branch": {
"type": "string",
"defaultValue": "master"
}
},
"variables": {
"name": "[toLower(replace(parameters('siteName'), '_', ''))]",
"subscriptionId": "[subscription().id]",
"location": "[parameters('siteLocation')]",
"hostingEnvironment": "",
"hostingPlanName": "[concat(variables('name'), '-plan')]",
"serverFarmResourceGroup": "[resourceGroup().name]",
"alwaysOn": true,
"sku": "PremiumV2",
"skuCode": "P2v2",
"workerSize": "4",
"workerSizeId": "4",
"numberOfWorkers": "1",
"currentStack": "dotnetcore",
"appInsightsName": "[variables('name')]",
"sqlServerName": "[concat(variables('name'), '-sqlsvr')]",
"sqlDatabaseName": "[concat(variables('name'), '-sqldb')]",
"collation": "SQL_Latin1_General_CP1_CI_AS",
"maxSizeBytes": 2147483648,
"sampleName": "",
"licenseType": "",
"readScaleOut": "Disabled",
"zoneRedundant": false,
"numberOfReplicas": 0,
"minCapacity": "",
"autoPauseDelay": "",
"sqlSkuName": "Basic",
"sqlTier": "Basic",
"locationCode": "[toLower(replace(variables('location'), ' ', ''))]",
"allowAzureIps": true,
"apiUrl": "[if(equals(parameters('deploymentMode'), 'standalone'), '/api/v1', 'https://f5dc03f4e99349f6b467.eastus.aksapp.io/webbff/v1')]",
"apiUrlShoppingCart": "[if(equals(parameters('deploymentMode'), 'standalone'), '/api/v1', 'https://f5dc03f4e99349f6b467.eastus.aksapp.io/cart-api')]",
"cosmosAccountName": "[concat(variables('name'), '-mongo')]",
"cosmosDatabaseName": "tailwind"
},
"resources": [
{
"apiVersion": "2018-02-01",
"name": "[variables('name')]",
"type": "Microsoft.Web/sites",
"location": "[variables('location')]",
"tags": {},
"dependsOn": [
"[concat('microsoft.insights/components/', variables('appInsightsName'))]",
"[concat('Microsoft.Web/serverfarms/', variables('hostingPlanName'))]",
"[concat('Microsoft.Sql/servers/', variables('sqlServerName'), '/databases/', variables('sqlDatabaseName'))]",
"[concat('Microsoft.DocumentDB/databaseAccounts/', variables('cosmosAccountName'))]",
"[concat('Microsoft.CognitiveServices/accounts/', variables('name'))]"
],
"properties": {
"name": "[variables('name')]",
"siteConfig": {
"appSettings": [
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(concat('microsoft.insights/components/', variables('appInsightsName')), '2015-05-01').InstrumentationKey]"
},
{
"name": "ApplicationInsightsAgent_EXTENSION_VERSION",
"value": "~2"
},
{
"name": "XDT_MicrosoftApplicationInsights_Mode",
"value": "recommended"
},
{
"name": "DiagnosticServices_EXTENSION_VERSION",
"value": "~3"
},
{
"name": "APPINSIGHTS_PROFILERFEATURE_VERSION",
"value": "1.0.0"
},
{
"name": "APPINSIGHTS_SNAPSHOTFEATURE_VERSION",
"value": "1.0.0"
},
{
"name": "InstrumentationEngine_EXTENSION_VERSION",
"value": "~1"
},
{
"name": "SnapshotDebugger_EXTENSION_VERSION",
"value": "~1"
},
{
"name": "XDT_MicrosoftApplicationInsights_BaseExtensions",
"value": "~1"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "10.15.2"
},
{
"name": "ApiUrl",
"value": "[variables('apiUrl')]"
},
{
"name": "ApiUrlShoppingCart",
"value": "[variables('apiUrlShoppingCart')]"
},
{
"name": "MongoConnectionString",
"value": "[if(equals(parameters('deploymentMode'), 'standalone'), listConnectionStrings(resourceId('Microsoft.DocumentDB/databaseAccounts', variables('cosmosAccountName')), '2015-04-08').connectionStrings[0].connectionString, '')]"
},
{
"name": "SqlConnectionString",
"value": "[if(equals(parameters('deploymentMode'), 'standalone'), concat('Server=tcp:', reference(concat('Microsoft.Sql/servers/', variables('sqlserverName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', variables('sqlDatabaseName'), ';Persist Security Info=False;User ID=', parameters('sqlLogin'), ';Password=', parameters('sqlPassword'), ';MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;'), '')]"
},
{
"name": "productImagesUrl",
"value": "https://raw.githubusercontent.com/microsoft/TailwindTraders-Backend/master/Deploy/tailwindtraders-images/product-detail"
},
{
"name": "Personalizer__ApiKey",
"value": "[if(parameters('enablePersonalizer'), listKeys(concat('Microsoft.CognitiveServices/accounts/', variables('name')),'2016-02-01-preview').key1, '')]"
},
{
"name": "Personalizer__Endpoint",
"value": "[if(parameters('enablePersonalizer'), reference(concat('Microsoft.CognitiveServices/accounts/', variables('name')),'2016-02-01-preview').endpoint, '')]"
}
],
"metadata": [
{
"name": "CURRENT_STACK",
"value": "[variables('currentStack')]"
}
],
"alwaysOn": "[variables('alwaysOn')]"
},
"serverFarmId": "[concat('/subscriptions/', variables('subscriptionId'),'/resourcegroups/', variables('serverFarmResourceGroup'), '/providers/Microsoft.Web/serverfarms/', variables('hostingPlanName'))]",
"hostingEnvironment": "[variables('hostingEnvironment')]",
"clientAffinityEnabled": true
},
"resources": [
{
"apiVersion": "2015-08-01",
"name": "web",
"type": "sourcecontrols",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('name'))]"
],
"properties": {
"RepoUrl": "[parameters('repoURL')]",
"branch": "[parameters('branch')]",
"IsManualIntegration": true
}
}
]
},
{
"apiVersion": "2018-02-01",
"name": "[variables('hostingPlanName')]",
"type": "Microsoft.Web/serverfarms",
"location": "[variables('location')]",
"kind": "",
"tags": {},
"dependsOn": [],
"properties": {
"name": "[variables('hostingPlanName')]",
"workerSize": "[variables('workerSize')]",
"workerSizeId": "[variables('workerSizeId')]",
"numberOfWorkers": "[variables('numberOfWorkers')]",
"hostingEnvironment": "[variables('hostingEnvironment')]"
},
"sku": {
"Tier": "[variables('sku')]",
"Name": "[variables('skuCode')]"
}
},
{
"apiVersion": "2015-05-01",
"name": "[variables('appInsightsName')]",
"type": "microsoft.insights/components",
"location": "[variables('locationCode')]",
"tags": null,
"properties": {
"ApplicationId": "[variables('name')]",
"Request_Source": "IbizaWebAppExtensionCreate"
}
},
{
"condition": "[equals(parameters('deploymentMode'), 'standalone')]",
"apiVersion": "2015-05-01-preview",
"location": "[variables('locationCode')]",
"tags": {},
"name": "[variables('sqlServerName')]",
"properties": {
"administratorLogin": "[parameters('sqlLogin')]",
"administratorLoginPassword": "[parameters('sqlPassword')]",
"version": "12.0"
},
"resources": [
{
"condition": "[equals(parameters('deploymentMode'), 'standalone')]",
"apiVersion": "2017-10-01-preview",
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('sqlServerName'))]"
],
"location": "[variables('locationCode')]",
"tags": {},
"name": "[variables('sqlDatabaseName')]",
"properties": {
"collation": "[variables('collation')]",
"maxSizeBytes": "[variables('maxSizeBytes')]",
"sampleName": "[variables('sampleName')]",
"zoneRedundant": "[variables('zoneRedundant')]",
"licenseType": "[variables('licenseType')]",
"readScale": "[variables('readScaleOut')]",
"readReplicaCount": "[variables('numberOfReplicas')]",
"minCapacity": "[variables('minCapacity')]",
"autoPauseDelay": "[variables('autoPauseDelay')]"
},
"sku": {
"name": "[variables('sqlSkuName')]",
"tier": "[variables('sqlTier')]"
},
"type": "databases"
},
{
"condition": "[and(equals(parameters('deploymentMode'), 'standalone'), variables('allowAzureIps'))]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('sqlServerName'))]"
],
"location": "[variables('locationCode')]",
"name": "AllowAllWindowsAzureIps",
"properties": {
"endIpAddress": "0.0.0.0",
"startIpAddress": "0.0.0.0"
},
"type": "firewallrules"
}
],
"type": "Microsoft.Sql/servers"
},
{
"condition": "[equals(parameters('deploymentMode'), 'standalone')]",
"type": "Microsoft.DocumentDB/databaseAccounts",
"name": "[variables('cosmosAccountName')]",
"apiVersion": "2016-03-31",
"location": "[variables('location')]",
"kind": "MongoDB",
"properties": {
"databaseAccountOfferType": "Standard"
}
},
{
"condition": "[equals(parameters('deploymentMode'), 'standalone')]",
"type": "Microsoft.DocumentDB/databaseAccounts/apis/databases",
"name": "[concat(variables('cosmosAccountName'), '/mongodb/', variables('cosmosDatabaseName'))]",
"apiVersion": "2016-03-31",
"dependsOn": [ "[resourceId('Microsoft.DocumentDB/databaseAccounts/', variables('cosmosAccountName'))]" ],
"properties":{
"resource":{
"id": "[variables('cosmosDatabaseName')]"
}
}
},
{
"condition": "[equals(parameters('deploymentMode'), 'standalone')]",
"type": "Microsoft.DocumentDb/databaseAccounts/apis/databases/collections",
"name": "[concat(variables('cosmosAccountName'), '/mongodb/', variables('cosmosDatabaseName'), '/cart')]",
"apiVersion": "2016-03-31",
"dependsOn": [ "[resourceId('Microsoft.DocumentDB/databaseAccounts/apis/databases', variables('cosmosAccountName'), 'mongodb', variables('cosmosDatabaseName'))]" ],
"properties":
{
"resource":{
"id": "cart",
"shardKey": { "email": "Hash" }
},
"options": { "throughput": "400" }
}
},
{
"type": "Microsoft.CognitiveServices/accounts",
"condition": "[parameters('enablePersonalizer')]",
"apiVersion": "2016-02-01-preview",
"name": "[variables('name')]",
"location": "westus2",
"sku": {
"name": "S0"
},
"kind": "Personalizer",
"properties": {}
}
]
}