-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
deploy_template.json
355 lines (355 loc) · 14.7 KB
/
deploy_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
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
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"IntuneCD Instance Name": {
"type": "string",
"minLength": 1,
"maxLength": 32
},
"IntuneCD Client ID": {
"type": "string",
"metadata": {
"description": "IntuneCD App Registration Client ID"
}
},
"IntuneCD Client Object ID": {
"type": "string",
"metadata": {
"description": "IntuneCD App Registration Client Object ID"
}
},
"IntuneCD Client Secret": {
"type": "securestring",
"metadata": {
"description": "IntuneCD App Registration Client Secret"
}
},
"IntuneCD Farm SKU": {
"type": "string",
"allowedValues": [
"Basic",
"Standard",
"Premium"
],
"defaultValue": "Basic"
},
"IntuneCD Farm SKU Code": {
"type": "string",
"allowedValues": [
"B1",
"B2",
"B3",
"S1",
"S2",
"S3",
"P1v3"
],
"defaultValue": "B1"
},
"IntuneCD DB Location": {
"type": "string",
"allowedValues": [
"Australia Central",
"Australia East",
"Australia Southeast",
"Brazil South",
"Canada Central",
"Canada East",
"Central India",
"Central US",
"East Asia",
"East US",
"East US 2",
"France Central",
"Germany West Central",
"Japan East",
"Japan West",
"Korea Central",
"Korea South",
"North Central US",
"North Europe",
"Norway East",
"South Africa North",
"South Central US",
"South India",
"Southeast Asia",
"Sweden Central",
"Switzerland North",
"UAE North",
"UK South",
"UK West",
"West Central US",
"West Europe",
"West India",
"West US",
"West US 2",
"West US 3"
],
"defaultValue": "Central US"
},
"IntuneCD DB Name": {
"type": "string",
"minLength": 1
},
"IntuneCD DB Edition": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"IntuneCD DB RequestedServiceObjectiveName": {
"type": "string",
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"S0",
"S1",
"S2",
"P1",
"P2",
"P3"
],
"metadata": {
"description": "Describes the performance level for Edition"
}
},
"IntuneCD DB AdminLogin": {
"type": "string",
"minLength": 1
},
"IntuneCD DB AdminLoginPassword": {
"type": "securestring"
},
"Timezone": {
"type": "string",
"defaultValue": "UTC",
"metadata": {
"description": "Timezone for IntuneCD scheduled jobs"
}
}
},
"resources": [
/* KEY VAULT */
{
"name": "[parameters('IntuneCD Instance Name')]",
"type": "Microsoft.KeyVault/vaults",
"location": "[resourceGroup().location]",
"apiVersion": "2021-10-01",
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('IntuneCD Instance Name'))]": "Resource",
"displayName": "IntuneCD"
},
"properties": {
"sku": {
"name": "standard",
"family": "A"
},
"tenantId": "[subscription().tenantId]",
"accessPolicies": [],
"enabledForDeployment": true,
"enabledForTemplateDeployment": true,
"enabledForDiskEncryption": true,
"enableRbacAuthorization": true
}
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2020-04-01-preview",
"name": "[guid(resourceGroup().id)]",
"dependsOn": [
"[concat('Microsoft.KeyVault/vaults/', parameters('IntuneCD Instance Name'))]"
],
"properties": {
"roleDefinitionId": "/providers/Microsoft.Authorization/roleDefinitions/00482a5a-887f-4fb3-b363-3b7fe8e74483",
"principalId": "[parameters('IntuneCD Client Object ID')]",
"principalType": "ServicePrincipal",
"scope": "[concat('/subscriptions/', subscription().subscriptionId, '/resourcegroups/', resourceGroup().name)]"
}
},
/* SERVER FARM */
{
"name": "[parameters('IntuneCD Instance Name')]",
"type": "Microsoft.Web/serverfarms",
"location": "[resourceGroup().location]",
"kind": "app,linux",
"apiVersion": "2018-11-01",
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults', parameters('IntuneCD Instance Name'))]"
],
"tags": {
"displayName": "IntuneCD"
},
"properties": {
"name": "[parameters('IntuneCD Instance Name')]",
"workerSize": 0,
"numberOfWorkers": 1,
"reserved": true
},
"sku": {
"Tier": "[parameters('IntuneCD Farm SKU')]",
"Name": "[parameters('IntuneCD Farm SKU Code')]"
}
},
/* DATABASE */
{
"name": "[variables('IntuneCDdbName')]",
"type": "Microsoft.Sql/servers",
"location": "[parameters('IntuneCD DB Location')]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('IntuneCD Instance Name'))]"
],
"tags": {
"displayName": "IntuneCD"
},
"properties": {
"administratorLogin": "[parameters('IntuneCD DB AdminLogin')]",
"administratorLoginPassword": "[parameters('IntuneCD DB AdminLoginPassword')]"
},
"resources": [
{
"name": "AllowAllWindowsAzureIps",
"type": "firewallrules",
"location": "[resourceGroup().location]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[concat('Microsoft.Sql/servers/', variables('IntuneCDdbName'))]"
],
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "0.0.0.0"
}
}
]
},
{
"name": "[variables('fullyQualifiedIntuneCDdbName')]",
"type": "Microsoft.Sql/servers/databases",
"location": "[parameters('IntuneCD DB Location')]",
"apiVersion": "2014-04-01-preview",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('IntuneCDdbName'))]"
],
"tags": {
"displayName": "IntuneCD"
},
"properties": {
"collation": "SQL_Latin1_General_CP1_CI_AS",
"edition": "[parameters('IntuneCD DB Edition')]",
"maxSizeBytes": "1073741824",
"requestedServiceObjectiveName": "[parameters('IntuneCD DB RequestedServiceObjectiveName')]"
}
},
/* WEB APP */
{
"apiVersion": "2018-11-01",
"name": "[parameters('IntuneCD Instance Name')]",
"type": "Microsoft.Web/sites",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('IntuneCDdbName'))]"
],
"tags": {
"[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('IntuneCD Instance Name'))]": "Resource",
"displayName": "IntuneCD"
},
"properties": {
"name": "[parameters('IntuneCD Instance Name')]",
"siteConfig": {
"appSettings": [
{
"name": "DOCKER_REGISTRY_SERVER_URL",
"value": "https://ghcr.io"
},
{
"name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE",
"value": "true"
},
{
"name": "SERVER_NAME",
"value": "[concat(variables('URL'), '.azurewebsites.net')]"
},
{
"name": "REDIRECT_PATH",
"value": "/auth/signin-oidc"
},
{
"name": "ADMIN_ROLE",
"value": "intunecd_admin"
},
{
"name": "AZDBDRIVER",
"value": "{ODBC Driver 17 for SQL Server}"
},
{
"name": "AZDBNAME",
"value": "[parameters('IntuneCD DB Name')]"
},
{
"name": "AZDBUSER",
"value": "[parameters('IntuneCD DB AdminLogin')]"
},
{
"name": "AZDBPW",
"value": "[parameters('IntuneCD DB AdminLoginPassword')]"
},
{
"name": "AZDBSERVER",
"value": "[concat(variables('IntuneCDdbName'), '.database.windows.net')]"
},
{
"name": "AZURE_TENANT_ID",
"value": "[subscription().tenantId]"
},
{
"name": "AZURE_CLIENT_ID",
"value": "[parameters('IntuneCD Client ID')]"
},
{
"name": "AZURE_CLIENT_SECRET",
"value": "[parameters('IntuneCD Client Secret')]"
},
{
"name": "AZURE_VAULT_URL",
"value": "[reference(resourceId('Microsoft.KeyVault/vaults', parameters('IntuneCD Instance Name')), '2018-02-14').vaultUri]"
},
{
"name": "BEAT_DB_URI",
"value": "sqlite:///db/schedule.db"
},
{
"name": "SCOPE",
"value": "[[]"
},
{
"name": "SECRET_KEY",
"value": "[uniqueString(resourceGroup().id)]"
},
{
"name": "SESSION_LIFETIME_HOURS",
"value": ""
},
{
"name": "TIMEZONE",
"value": "[parameters('Timezone')]"
}
],
"linuxFxVersion": "COMPOSE|dmVyc2lvbjogIjMuOCIKCnNlcnZpY2VzOgoKICB3ZWI6CiAgICBpbWFnZTogZ2hjci5pby9hbG1lbnNjb3JuZXIvaW50dW5lY2QtbW9uaXRvcjpsYXRlc3QKICAgIHJlc3RhcnQ6IGFsd2F5cwogICAgZW50cnlwb2ludDogLi9zZXJ2ZXItZW50cnlwb2ludC5zaAogICAgZXhwb3NlOgogICAgICAtIDgwODA6ODA4MAogICAgdm9sdW1lczoKICAgICAgLSAke1dFQkFQUF9TVE9SQUdFX0hPTUV9L2RiOi9pbnR1bmVjZC9kYgogICAgICAtICR7V0VCQVBQX1NUT1JBR0VfSE9NRX0vZG9jdW1lbnRhdGlvbjovZG9jdW1lbnRhdGlvbgoKICByZWRpczoKICAgIGltYWdlOiBnaGNyLmlvL2FsbWVuc2Nvcm5lci9pbnR1bmVjZC1tb25pdG9yL3JlZGlzOmxhdGVzdAogICAgcmVzdGFydDogYWx3YXlzCgogIHdvcmtlcjoKICAgIGltYWdlOiBnaGNyLmlvL2FsbWVuc2Nvcm5lci9pbnR1bmVjZC1tb25pdG9yL3dvcmtlcj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yBuZ2lueCAtZyAnZGFlbW9uIG9mZjsnIl0KICAgIHBvcnRzOgogICAgICAtIDgwOjgw",
"alwaysOn": false
},
"webSocketsEnabled": true,
"httpsOnly": true,
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms/', parameters('IntuneCD Instance Name'))]"
}
}
],
"variables": {
"fullyQualifiedIntuneCDdbName": "[concat(variables('IntuneCDdbName'), '/', parameters('IntuneCD DB Name'))]",
"IntuneCDdbName": "[concat('intunecd', uniqueString(resourceGroup().id))]",
"URL": "[concat('https://', parameters('IntuneCD Instance Name'))]"
}
}