This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 159
/
azuredeploy.json
210 lines (210 loc) · 7.6 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
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appServiceSku":{
"type": "string",
"defaultValue" : "S2",
"allowedValues":[
"S2"
],
"metadata": {
"description": "The SKU of App Service Plan "
}
},
"acrSku": {
"type": "string",
"metadata": {
"description": "Tier of your Azure Container Registry."
},
"defaultValue": "Basic",
"allowedValues": [
"Basic",
"Standard",
"Premium"
]
},
"acrAdminUserEnabled": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Enable admin user that have push / pull permission to the registry."
}
},
"sqlAdministratorLogin": {
"type": "string",
"defaultValue": "demousersa",
"metadata": {
"description": "The administrator username of the SQL Server."
}
},
"sqlAdministratorLoginPassword": {
"type": "securestring",
"defaultValue": "demo@pass123",
"metadata": {
"description": "The administrator password of the SQL Server."
}
},
"transparentDataEncryption": {
"type": "string",
"allowedValues": [
"Enabled",
"Disabled"
],
"defaultValue": "Enabled",
"metadata": {
"description": "Enable or disable Transparent Data Encryption (TDE) for the database."
}
},
"allowAzureIPs": {
"defaultValue": true,
"type": "bool",
"metadata": {
"description": "Allow Azure services to access server."
}
},
"connectionType": {
"defaultValue": "Default",
"allowedValues": [ "Default", "Redirect", "Proxy" ],
"type": "string",
"metadata": {
"description": "SQL logical server connection type."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
},
"simulatorLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for the simulator (does not currently run in all regions)."
}
},
"resourceRandomSuffix": {
"type": "string",
"defaultValue": "[uniqueString(subscription().subscriptionId)]",
"metadata": {
"description": "The suffix that will be appended after the known resource name 'openhack'."
}
}
},
"variables": {
"appServicePlanName": "[concat('openhack', parameters('resourceRandomSuffix'),'plan')]",
"acrName": "[concat('openhack', parameters('resourceRandomSuffix'),'acr')]",
"dbServerName": "[concat('openhack', parameters('resourceRandomSuffix'),'sql')]",
"databaseName": "mydrivingDB",
"databaseCollation": "SQL_Latin1_General_CP1_CI_AS"
},
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"name": "[variables('appServicePlanName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('appServiceSku')]"
},
"kind": "linux",
"properties":{
"reserved":true
}
},
{
"name": "[variables('acrName')]",
"type": "Microsoft.ContainerRegistry/registries",
"location": "[parameters('location')]",
"apiVersion": "2017-10-01",
"sku": {
"name": "[parameters('acrSku')]",
"tier": "[parameters('acrSku')]"
},
"properties": {
"adminUserEnabled": "[parameters('acrAdminUserEnabled')]"
}
},
{
"type": "Microsoft.Sql/servers",
"apiVersion": "2018-06-01-preview",
"name": "[variables('dbServerName')]",
"location": "[parameters('location')]",
"properties": {
"administratorLogin": "[parameters('sqlAdministratorLogin')]",
"administratorLoginPassword": "[parameters('sqlAdministratorLoginPassword')]",
"version": "12.0"
},
"resources": [
{
"condition": "[parameters('allowAzureIPs')]",
"type": "firewallRules",
"apiVersion": "2018-06-01-preview",
"name": "AllowAllWindowsAzureIps",
"location": "[parameters('location')]",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('dbServerName'))]"
],
"properties": {
"endIpAddress": "0.0.0.0",
"startIpAddress": "0.0.0.0"
}
},
{
"type": "connectionPolicies",
"apiVersion": "2014-04-01",
"name": "Default",
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('dbServerName'))]"
],
"properties": {
"connectionType": "[parameters('connectionType')]"
}
}
]
},
{
"name": "[concat(variables('dbServerName'),'/',variables('databaseName'))]",
"type": "Microsoft.Sql/servers/databases",
"apiVersion": "2019-06-01-preview",
"location": "[parameters('location')]",
"sku": {
"name": "S3",
"tier": "Standard",
"capacity": 100
},
"properties": {
"collation": "[variables('databaseCollation')]",
"maxSizeBytes": 268435456000
},
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('dbServerName'))]"
]
},
{
"comments": "Transparent Data Encryption",
"name": "[concat(variables('dbServerName'),'/',variables('databaseName'),'/current')]",
"type": "Microsoft.Sql/servers/databases/transparentDataEncryption",
"apiVersion": "2014-04-01",
"properties": {
"status": "[parameters('transparentDataEncryption')]"
},
"dependsOn": [
"[resourceId('Microsoft.Sql/servers', variables('dbServerName'))]",
"[resourceId('Microsoft.Sql/servers/databases', variables('dbServerName'), variables('databaseName'))]"
]
}
],
"outputs": {
"acrLoginServer": {
"type": "string",
"value": "[reference(resourceId('Microsoft.ContainerRegistry/registries', variables('acrName'))).loginServer]"
},
"sqlServerFqdn": {
"type": "string",
"value": "[reference(concat('Microsoft.Sql/servers/', variables('dbServerName'))).fullyQualifiedDomainName]"
}
}
}