-
Notifications
You must be signed in to change notification settings - Fork 0
/
prod_deployment_template.json
170 lines (170 loc) · 7.01 KB
/
prod_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
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
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"webSiteName": {
"type": "String",
"metadata": {
"description": "Website name should be unique across azurewebsites.net domain"
},
"minLength": 3
}
},
"variables": {
"hostingPlanName": "[concat(take(toLower(parameters('webSiteName')), 16), '-asp-', uniqueString(resourceGroup().id, parameters('webSiteName')))]",
"serverName": "[concat(take(toLower(parameters('webSiteName')), 16), '-pgdb-', uniqueString(resourceGroup().id, parameters('webSiteName')))]",
"databaseName": "kolibri",
"storageAccountName": "[take(concat(take(toLower(replace(parameters('webSiteName'), '-', '')), 16), 'st', uniqueString(resourceGroup().id, parameters('webSiteName'))), 24)]",
"fileShareName": "[concat(variables('storageAccountName'), '/default/kolibri')]",
"administratorLogin": "[concat('admin', uniqueString(resourceGroup().id, parameters('webSiteName')))]",
"administratorLoginPassword": "[concat('P@5s!', uniqueString(resourceGroup().id, parameters('webSiteName')))]"
},
"resources": [
{
"type": "Microsoft.Web/sites",
"apiVersion": "2020-06-01",
"name": "[parameters('webSiteName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[variables('hostingPlanName')]",
"[variables('databaseName')]"
],
"identity": {
"type": "SystemAssigned"
},
"tags": {},
"properties": {
"name": "[parameters('webSiteName')]",
"siteConfig": {
"linuxFxVersion": "DOCKER|sanmoy/kolibri-alpine",
"appCommandLine": "",
"alwaysOn": "true",
"http20Enabled": true
},
"serverFarmId": "[variables('hostingPlanName')]",
"clientAffinityEnabled": false,
"httpsOnly": true
},
"resources": [
{
"name": "appsettings",
"type": "config",
"apiVersion": "2020-06-01",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('webSiteName'))]"
],
"properties": {
"DOCKER_REGISTRY_SERVER_URL": "https://index.docker.io",
"DOCKER_REGISTRY_SERVER_USERNAME": "",
"DOCKER_REGISTRY_SERVER_PASSWORD": "",
"WEBSITES_ENABLE_APP_SERVICE_STORAGE": "true",
"KOLIBRI_DATABASE_ENGINE": "postgres",
"KOLIBRI_DATABASE_NAME": "[variables('databaseName')]",
"KOLIBRI_DATABASE_HOST": "[reference(resourceId('Microsoft.DBforPostgreSQL/servers',variables('serverName'))).fullyQualifiedDomainName]",
"KOLIBRI_DATABASE_PORT": "5432",
"KOLIBRI_DATABASE_USER": "[concat(variables('administratorLogin'), '@', variables('serverName'))]",
"KOLIBRI_DATABASE_PASSWORD": "[variables('administratorLoginPassword')]",
"KOLIBRI_DATABASE_SSL": "true"
}
}
]
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-11-01",
"name": "[variables('hostingPlanName')]",
"location": "[resourceGroup().location]",
"dependsOn": [],
"tags": {},
"sku": {
"Tier": "PremiumV2",
"Name": "P1v2"
},
"kind": "linux",
"properties": {
"name": "[variables('hostingPlanName')]",
"workerSize": "3",
"workerSizeId": "3",
"numberOfWorkers": "1",
"reserved": true
}
},
{
"type": "Microsoft.DBforPostgreSQL/servers",
"apiVersion": "2017-12-01",
"name": "[variables('serverName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "GP_Gen5_4",
"tier": "GeneralPurpose",
"capacity": "4",
"size": "51200",
"family": "Gen5"
},
"properties": {
"createMode": "Default",
"version": "11",
"administratorLogin": "[variables('administratorLogin')]",
"administratorLoginPassword": "[variables('administratorLoginPassword')]",
"storageProfile": {
"storageMB": 51200,
"backupRetentionDays": 7,
"geoRedundantBackup": "Disabled",
"storageAutoGrow": "Enabled"
}
},
"resources": [
{
"type": "firewallrules",
"apiVersion": "2017-12-01",
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers/', variables('serverName'))]"
],
"location": "[resourceGroup().location]",
"name": "[concat(variables('serverName'),'firewall')]",
"properties": {
"startIpAddress": "0.0.0.0",
"endIpAddress": "255.255.255.255"
}
},
{
"name": "[variables('databaseName')]",
"type": "databases",
"apiVersion": "2017-12-01",
"properties": {
"charset": "utf8",
"collation": "English_United States.1252"
},
"dependsOn": [
"[resourceId('Microsoft.DBforPostgreSQL/servers/', variables('serverName'))]"
]
}
]
},
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[variables('storageAccountName')]",
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"accessTier": "Hot"
}
},
{
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"apiVersion": "2019-06-01",
"name": "[variables('fileShareName')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
],
"properties": {
"shareQuota": "256"
}
}
]
}