1+ {
2+ "$schema" : " http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" ,
3+ "contentVersion" : " 1.0.0.0" ,
4+ "parameters" : {
5+ "skuName" : {
6+ "type" : " string" ,
7+ "defaultValue" : " F1" ,
8+ "allowedValues" : [
9+ " F1" ,
10+ " D1" ,
11+ " B1" ,
12+ " B2" ,
13+ " B3" ,
14+ " S1" ,
15+ " S2" ,
16+ " S3" ,
17+ " P1" ,
18+ " P2" ,
19+ " P3" ,
20+ " P4"
21+ ],
22+ "metadata" : {
23+ "description" : " Describes plan's pricing tier and instance size. Check details at https://azure.microsoft.com/en-us/pricing/details/app-service/"
24+ }
25+ },
26+ "skuCapacity" : {
27+ "type" : " int" ,
28+ "defaultValue" : 1 ,
29+ "minValue" : 1 ,
30+ "metadata" : {
31+ "description" : " Describes plan's instance count"
32+ }
33+ },
34+ "administratorLogin" : {
35+ "type" : " string" ,
36+ "metadata" : {
37+ "description" : " The admin user of the SQL Server"
38+ }
39+ },
40+ "administratorLoginPassword" : {
41+ "type" : " securestring" ,
42+ "metadata" : {
43+ "description" : " The password of the admin user of the SQL Server"
44+ }
45+ },
46+ "databaseName" : {
47+ "type" : " string" ,
48+ "metadata" : {
49+ "description" : " The name of the new database to create."
50+ }
51+ },
52+ "collation" : {
53+ "type" : " string" ,
54+ "defaultValue" : " SQL_Latin1_General_CP1_CI_AS" ,
55+ "metadata" : {
56+ "description" : " The database collation for governing the proper use of characters."
57+ }
58+ },
59+ "edition" : {
60+ "type" : " string" ,
61+ "defaultValue" : " Basic" ,
62+ "allowedValues" : [
63+ " Basic" ,
64+ " Standard" ,
65+ " Premium"
66+ ],
67+ "metadata" : {
68+ "description" : " The type of database to create."
69+ }
70+ },
71+ "maxSizeBytes" : {
72+ "type" : " string" ,
73+ "defaultValue" : " 1073741824" ,
74+ "metadata" : {
75+ "description" : " The maximum size, in bytes, for the database"
76+ }
77+ },
78+ "requestedServiceObjectiveName" : {
79+ "type" : " string" ,
80+ "defaultValue" : " Basic" ,
81+ "allowedValues" : [
82+ " Basic" ,
83+ " S0" ,
84+ " S1" ,
85+ " S2" ,
86+ " P1" ,
87+ " P2" ,
88+ " P3"
89+ ],
90+ "metadata" : {
91+ "description" : " Describes the performance level for Edition"
92+ }
93+ },
94+ "cacheSKUName" : {
95+ "type" : " string" ,
96+ "allowedValues" : [
97+ " Basic" ,
98+ " Standard"
99+ ],
100+ "defaultValue" : " Basic" ,
101+ "metadata" : {
102+ "description" : " The pricing tier of the new Azure Redis Cache."
103+ }
104+ },
105+ "cacheSKUFamily" : {
106+ "type" : " string" ,
107+ "allowedValues" : [
108+ " C"
109+ ],
110+ "defaultValue" : " C" ,
111+ "metadata" : {
112+ "description" : " The family for the sku."
113+ }
114+ },
115+ "cacheSKUCapacity" : {
116+ "type" : " int" ,
117+ "allowedValues" : [
118+ 0 ,
119+ 1 ,
120+ 2 ,
121+ 3 ,
122+ 4 ,
123+ 5 ,
124+ 6
125+ ],
126+ "defaultValue" : 0 ,
127+ "metadata" : {
128+ "description" : " The size of the new Azure Redis Cache instance. "
129+ }
130+ }
131+ },
132+ "variables" : {
133+ "hostingPlanName" : " [concat('hostingplan-', uniqueString(resourceGroup().id))]" ,
134+ "webSiteName" : " [concat('webSite-', uniqueString(resourceGroup().id))]" ,
135+ "sqlserverName" : " [concat('sqlserver-', uniqueString(resourceGroup().id))]" ,
136+ "cacheName" : " [concat('cache-', uniqueString(resourceGroup().id))]" ,
137+ "adminWebName" : " [concat('CBAdminWeb-', uniqueString(resourceGroup().id))]" ,
138+ "storageName" : " [concat('STORAGE_', uniqueString(resourceGroup().id))]" ,
139+ "socketName" : " [concat('CBSocket-', uniqueString(resourceGroup().id))]"
140+ },
141+ "resources" : [
142+ { // SQL Server
143+ "name" : " [variables('sqlserverName')]" ,
144+ "type" : " Microsoft.Sql/servers" ,
145+ "location" : " [resourceGroup().location]" ,
146+ "tags" : {
147+ "displayName" : " SqlServer"
148+ },
149+ "apiVersion" : " 2014-04-01-preview" ,
150+ "properties" : {
151+ "administratorLogin" : " [parameters('administratorLogin')]" ,
152+ "administratorLoginPassword" : " [parameters('administratorLoginPassword')]" ,
153+ "version" : " 12.0"
154+ },
155+ "resources" : [
156+ {
157+ "name" : " [parameters('databaseName')]" ,
158+ "type" : " databases" ,
159+ "location" : " [resourceGroup().location]" ,
160+ "tags" : {
161+ "displayName" : " Database"
162+ },
163+ "apiVersion" : " 2014-04-01-preview" ,
164+ "dependsOn" : [
165+ " [concat('Microsoft.Sql/servers/', variables('sqlserverName'))]"
166+ ],
167+ "properties" : {
168+ "edition" : " [parameters('edition')]" ,
169+ "collation" : " [parameters('collation')]" ,
170+ "maxSizeBytes" : " [parameters('maxSizeBytes')]" ,
171+ "requestedServiceObjectiveName" : " [parameters('requestedServiceObjectiveName')]"
172+ }
173+ },
174+ {
175+ "type" : " firewallrules" ,
176+ "apiVersion" : " 2014-04-01-preview" ,
177+ "dependsOn" : [
178+ " [concat('Microsoft.Sql/servers/', variables('sqlserverName'))]"
179+ ],
180+ "location" : " [resourceGroup().location]" ,
181+ "name" : " AllowAllWindowsAzureIps" ,
182+ "properties" : {
183+ "endIpAddress" : " 0.0.0.0" ,
184+ "startIpAddress" : " 0.0.0.0"
185+ }
186+ }
187+ ]
188+ },
189+ { // Server Hosting Plan
190+ "apiVersion" : " 2015-08-01" ,
191+ "name" : " [variables('hostingPlanName')]" ,
192+ "type" : " Microsoft.Web/serverfarms" ,
193+ "location" : " [resourceGroup().location]" ,
194+ "tags" : {
195+ "displayName" : " HostingPlan"
196+ },
197+ "sku" : {
198+ "name" : " [parameters('skuName')]" ,
199+ "capacity" : " [parameters('skuCapacity')]"
200+ },
201+ "properties" : {
202+ "name" : " [variables('hostingPlanName')]"
203+ }
204+ },
205+ { // Mobile Apps
206+ "apiVersion" : " 2015-08-01" ,
207+ "name" : " [variables('webSiteName')]" ,
208+ "type" : " Microsoft.Web/sites" ,
209+ "kind" : " mobileapp" ,
210+ "location" : " [resourceGroup().location]" ,
211+ "dependsOn" : [
212+ " [concat('Microsoft.Web/serverFarms/', variables('hostingPlanName'))]" ,
213+ " [concat('Microsoft.Cache/Redis/', variables('cacheName'))]"
214+ ],
215+ "tags" : {
216+ "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', variables('hostingPlanName'))]" : " empty" ,
217+ "displayName" : " Website"
218+ },
219+ "properties" : {
220+ "name" : " [variables('webSiteName')]" ,
221+ "serverFarmId" : " [resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
222+ },
223+ "resources" : [
224+ {
225+ "apiVersion" : " 2015-08-01" ,
226+ "type" : " config" ,
227+ "name" : " connectionstrings" ,
228+ "dependsOn" : [
229+ " [concat('Microsoft.Web/Sites/', variables('webSiteName'))]" ,
230+ " [concat('Microsoft.Sql/servers/', variables('sqlserverName'))]"
231+ ],
232+ "properties" : {
233+ "CloudBreadDBConString" : {
234+ "value" : " [concat('Server=tcp:', reference(concat('Microsoft.Sql/servers/', variables('sqlserverName'))).fullyQualifiedDomainName, ',1433;Initial Catalog=', parameters('databaseName'), ';User Id=', parameters('administratorLogin'), '@', variables('sqlserverName'), ';Password=', parameters('administratorLoginPassword'), ';')]" ,
235+ "type" : " SQLServer"
236+ },
237+ "CloudBreadStorageConString" : {
238+ "value" : " [concat('DefaultEndpointsProtocol=https;AccountName=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)" ,
239+ "type" : " Custom"
240+ }
241+ }
242+ },
243+ {
244+ "apiVersion" : " 2015-08-01" ,
245+ "type" : " config" ,
246+ "name" : " appsettings" ,
247+ "dependsOn" : [
248+ " [concat('Microsoft.Web/Sites/', variables('webSiteName'))]" ,
249+ " [concat('Microsoft.Cache/Redis/', variables('cacheName'))]"
250+ ],
251+ "properties" : {
252+ "CacheConnection" : " [concat(variables('cacheName'),'.redis.cache.windows.net,abortConnect=false,ssl=true,password=', listKeys(resourceId('Microsoft.Cache/Redis', variables('cacheName')), '2015-08-01').primaryKey)]"
253+ }
254+ }
255+ ]
256+ },
257+ { // Redis Cache
258+ "name" : " [variables('cacheName')]" ,
259+ "type" : " Microsoft.Cache/Redis" ,
260+ "location" : " [resourceGroup().location]" ,
261+ "apiVersion" : " 2015-08-01" ,
262+ "dependsOn" : [],
263+ "tags" : {
264+ "displayName" : " cache"
265+ },
266+ "properties" : {
267+ "sku" : {
268+ "name" : " [parameters('cacheSKUName')]" ,
269+ "family" : " [parameters('cacheSKUFamily')]" ,
270+ "capacity" : " [parameters('cacheSKUCapacity')]"
271+ }
272+ }
273+ },
274+ { // Admin Web Apps
275+ "apiVersion" : " 2015-08-01" ,
276+ "name" : " [variables('adminWebName')]" ,
277+ "type" : " Microsoft.Web/sites" ,
278+ "kind" : " api" ,
279+ "location" : " [resourceGroup().location]" ,
280+ "dependsOn" : [
281+ " [concat('Microsoft.Web/serverFarms/', variables('hostingPlanName'))]" ,
282+ " [concat('Microsoft.Cache/Redis/', variables('cacheName'))]"
283+ ],
284+ "tags" : {
285+ "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', variables('hostingPlanName'))]" : " empty" ,
286+ "displayName" : " AdminWebsite"
287+ },
288+ "properties" : {
289+ "name" : " [variables('adminWebName')]" ,
290+ "serverFarmId" : " [resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
291+ },
292+ "resources" : []
293+ },
294+ { // Storage Accounts
295+ "name" : " [variables('storageName')]" ,
296+ "type" : " Microsoft.Storage/storageAccounts" ,
297+ "location" : " [resourceGroup().location]" ,
298+ "apiVersion" : " 2015-06-15" ,
299+ "properties" : {
300+ "accountType" : " Standard_LRS"
301+ }
302+ },
303+ { // Socket Server
304+ "apiVersion" : " 2015-08-01" ,
305+ "name" : " [variables('socketName')]" ,
306+ "type" : " Microsoft.Web/sites" ,
307+ "kind" : " api" ,
308+ "location" : " [resourceGroup().location]" ,
309+ "dependsOn" : [
310+ " [concat('Microsoft.Web/serverFarms/', variables('hostingPlanName'))]" ,
311+ " [concat('Microsoft.Cache/Redis/', variables('cacheName'))]"
312+ ],
313+ "tags" : {
314+ "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', variables('hostingPlanName'))]" : " empty" ,
315+ "displayName" : " SocketWebServer"
316+ },
317+ "properties" : {
318+ "name" : " [variables('socketName')]" ,
319+ "serverFarmId" : " [resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]"
320+ },
321+ "resources" : []
322+ }
323+ ]
324+ }
0 commit comments