1+ {
2+ "$schema" : " https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json" ,
3+ "contentVersion" : " 1.0.0.0" ,
4+ "parameters" : {
5+ "name" : {
6+ "type" : " string" ,
7+ "defaultValue" : " [resourceGroup().name]"
8+ },
9+ "location" : {
10+ "type" : " string" ,
11+ "defaultValue" : " [resourceGroup().location]"
12+ },
13+ "microsoftAppId" : {
14+ "type" : " string"
15+ },
16+ "microsoftAppPassword" : {
17+ "type" : " string"
18+ },
19+ "cosmosDbName" : {
20+ "type" : " string" ,
21+ "defaultValue" : " [toLower(parameters('name'))]"
22+ },
23+ "storageAccountName" : {
24+ "type" : " string" ,
25+ "defaultValue" : " [toLower(parameters('name'))]"
26+ },
27+ "appServicePlanName" : {
28+ "type" : " string" ,
29+ "defaultValue" : " [parameters('name')]"
30+ },
31+ "appServicePlanSku" : {
32+ "type" : " object" ,
33+ "defaultValue" : {
34+ "tier" : " Standard" ,
35+ "name" : " S1"
36+ }
37+ },
38+ "appInsightsName" : {
39+ "type" : " string" ,
40+ "defaultValue" : " [parameters('name')]"
41+ },
42+ "appInsightsLocation" : {
43+ "type" : " string" ,
44+ "defaultValue" : " westus2"
45+ },
46+ "botWebAppName" : {
47+ "type" : " string" ,
48+ "defaultValue" : " [parameters('name')]"
49+ },
50+ "botServiceName" : {
51+ "type" : " string" ,
52+ "defaultValue" : " [parameters('name')]"
53+ },
54+ "botServiceSku" : {
55+ "type" : " string" ,
56+ "defaultValue" : " S1"
57+ },
58+ "contentModeratorName" : {
59+ "type" : " string" ,
60+ "defaultValue" : " [concat(parameters('name'), '-cm')]"
61+ },
62+ "contentModeratorSku" : {
63+ "type" : " string" ,
64+ "defaultValue" : " S0"
65+ },
66+ "contentModeratorLocation" : {
67+ "type" : " string" ,
68+ "defaultValue" : " [resourceGroup().location]"
69+ },
70+ "luisServiceName" : {
71+ "type" : " string" ,
72+ "defaultValue" : " [concat(parameters('name'), '-luis')]"
73+ },
74+ "luisServiceSku" : {
75+ "type" : " string" ,
76+ "defaultValue" : " S0"
77+ },
78+ "luisServiceLocation" : {
79+ "type" : " string" ,
80+ "defaultValue" : " [resourceGroup().location]"
81+ },
82+ "qnaMakerServiceName" : {
83+ "type" : " string" ,
84+ "defaultValue" : " [concat(parameters('name'), '-qna')]"
85+ },
86+ "qnaMakerServiceSku" : {
87+ "type" : " string" ,
88+ "defaultValue" : " S0"
89+ },
90+ "qnaServiceLocation" : {
91+ "type" : " string" ,
92+ "defaultValue" : " [resourceGroup().location]"
93+ },
94+ "qnaMakerSearchName" : {
95+ "type" : " string" ,
96+ "defaultValue" : " [toLower(concat(parameters('name'), '-search'))]"
97+ },
98+ "qnaMakerSearchSku" : {
99+ "type" : " string" ,
100+ "defaultValue" : " basic"
101+ },
102+ "qnaMakerWebAppName" : {
103+ "type" : " string" ,
104+ "defaultValue" : " [concat(parameters('name'), '-qnahost')]"
105+ }
106+ },
107+ "variables" : {
108+ "botEndpoint" : " [concat('https://', toLower(parameters('botWebAppName')), '.azurewebsites.net/api/messages')]" ,
109+ "cleanStorageAccountName" : " [toLower(take(replace(replace(parameters('storageAccountName'), '-', ''), '_', ''), 24))]"
110+ },
111+ "resources" : [
112+ {
113+ "apiVersion" : " 2018-02-01" ,
114+ "name" : " 3822b5f4-d098-4b57-9ee6-3bee686aec4c" ,
115+ "type" : " Microsoft.Resources/deployments" ,
116+ "properties" : {
117+ "mode" : " Incremental" ,
118+ "template" : {
119+ "$schema" : " https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#" ,
120+ "contentVersion" : " 1.0.0.0" ,
121+ "resources" : []
122+ }
123+ }
124+ },
125+ {
126+ "comments" : " CosmosDB for bot state." ,
127+ "type" : " Microsoft.DocumentDB/databaseAccounts" ,
128+ "kind" : " GlobalDocumentDB" ,
129+ "apiVersion" : " 2015-04-08" ,
130+ "name" : " [parameters('cosmosDbName')]" ,
131+ "location" : " [parameters('location')]" ,
132+ "properties" : {
133+ "databaseAccountOfferType" : " Standard" ,
134+ "locations" : [
135+ {
136+ "locationName" : " [parameters('location')]" ,
137+ "failoverPriority" : 0
138+ }
139+ ]
140+ }
141+ },
142+ {
143+ "comments" : " storage account" ,
144+ "type" : " Microsoft.Storage/storageAccounts" ,
145+ "kind" : " StorageV2" ,
146+ "apiVersion" : " 2018-07-01" ,
147+ "name" : " [variables('cleanStorageAccountName')]" ,
148+ "location" : " [parameters('location')]" ,
149+ "sku" : {
150+ "name" : " Standard_LRS"
151+ }
152+ },
153+ {
154+ "comments" : " app service plan" ,
155+ "type" : " Microsoft.Web/serverFarms" ,
156+ "apiVersion" : " 2018-02-01" ,
157+ "name" : " [parameters('appServicePlanName')]" ,
158+ "location" : " [parameters('location')]" ,
159+ "sku" : " [parameters('appServicePlanSku')]" ,
160+ "properties" : {}
161+ },
162+ {
163+ "comments" : " app insights" ,
164+ "type" : " Microsoft.Insights/components" ,
165+ "kind" : " web" ,
166+ "apiVersion" : " 2015-05-01" ,
167+ "name" : " [parameters('appInsightsName')]" ,
168+ "location" : " [parameters('appInsightsLocation')]" ,
169+ "properties" : {
170+ "Application_Type" : " web"
171+ }
172+ },
173+ {
174+ "comments" : " bot web app" ,
175+ "type" : " Microsoft.Web/sites" ,
176+ "apiVersion" : " 2018-02-01" ,
177+ "name" : " [parameters('botWebAppName')]" ,
178+ "location" : " [parameters('location')]" ,
179+ "properties" : {
180+ "serverFarmId" : " [resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]" ,
181+ "siteConfig" : {
182+ "appSettings" : [
183+ {
184+ "name" : " MicrosoftAppId" ,
185+ "value" : " [parameters('microsoftAppId')]"
186+ },
187+ {
188+ "name" : " MicrosoftAppPassword" ,
189+ "value" : " [parameters('microsoftAppPassword')]"
190+ }
191+ ]
192+ }
193+ },
194+ "dependsOn" : [
195+ " [resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]"
196+ ]
197+ },
198+ {
199+ "comments" : " bot service" ,
200+ "type" : " Microsoft.BotService/botServices" ,
201+ "kind" : " sdk" ,
202+ "apiVersion" : " 2018-07-12" ,
203+ "name" : " [parameters('botServiceName')]" ,
204+ "location" : " global" ,
205+ "sku" : {
206+ "name" : " [parameters('botServiceSku')]"
207+ },
208+ "properties" : {
209+ "displayName" : " [parameters('botServiceName')]" ,
210+ "endpoint" : " [variables('botEndpoint')]" ,
211+ "msaAppId" : " [parameters('microsoftAppId')]" ,
212+ "developerAppInsightKey" : " [reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).InstrumentationKey]" ,
213+ "developerAppInsightsApplicationId" : " [reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).ApplicationId]"
214+ }
215+ },
216+ {
217+ "comments" : " Content Moderator service for detecting PII and racy content." ,
218+ "type" : " Microsoft.CognitiveServices/accounts" ,
219+ "kind" : " ContentModerator" ,
220+ "apiVersion" : " 2017-04-18" ,
221+ "name" : " [parameters('contentModeratorName')]" ,
222+ "location" : " [parameters('contentModeratorLocation')]" ,
223+ "sku" : {
224+ "name" : " [parameters('contentModeratorSku')]"
225+ }
226+ },
227+ {
228+ "comments" : " Cognitive service key for all LUIS apps." ,
229+ "type" : " Microsoft.CognitiveServices/accounts" ,
230+ "kind" : " LUIS" ,
231+ "apiVersion" : " 2017-04-18" ,
232+ "name" : " [parameters('luisServiceName')]" ,
233+ "location" : " [parameters('luisServiceLocation')]" ,
234+ "sku" : {
235+ "name" : " [parameters('luisServiceSku')]"
236+ }
237+ },
238+ {
239+ "comments" : " Cognitive service key for all QnA Maker knowledgebases." ,
240+ "type" : " Microsoft.CognitiveServices/accounts" ,
241+ "kind" : " QnAMaker" ,
242+ "apiVersion" : " 2017-04-18" ,
243+ "name" : " [parameters('qnaMakerServiceName')]" ,
244+ "location" : " [parameters('qnaServiceLocation')]" ,
245+ "sku" : {
246+ "name" : " [parameters('qnaMakerServiceSku')]"
247+ },
248+ "properties" : {
249+ "apiProperties" : {
250+ "qnaRuntimeEndpoint" : " [concat('https://',reference(resourceId('Microsoft.Web/sites', parameters('qnaMakerWebAppName'))).hostNames[0])]"
251+ }
252+ },
253+ "dependsOn" : [
254+ " [resourceId('Microsoft.Web/Sites', parameters('qnaMakerWebAppName'))]" ,
255+ " [resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName'))]" ,
256+ " [resourceId('microsoft.insights/components/', parameters('appInsightsName'))]"
257+ ]
258+ },
259+ {
260+ "comments" : " Search service for QnA Maker service." ,
261+ "type" : " Microsoft.Search/searchServices" ,
262+ "apiVersion" : " 2015-08-19" ,
263+ "name" : " [parameters('qnaMakerSearchName')]" ,
264+ "location" : " [parameters('qnaServiceLocation')]" ,
265+ "sku" : {
266+ "name" : " [parameters('qnaMakerSearchSku')]"
267+ },
268+ "properties" : {
269+ "replicaCount" : 1 ,
270+ "partitionCount" : 1 ,
271+ "hostingMode" : " default"
272+ }
273+ },
274+ {
275+ "comments" : " Web app for QnA Maker service." ,
276+ "type" : " Microsoft.Web/sites" ,
277+ "apiVersion" : " 2016-08-01" ,
278+ "name" : " [parameters('qnaMakerWebAppName')]" ,
279+ "location" : " [parameters('qnaServiceLocation')]" ,
280+ "properties" : {
281+ "enabled" : true ,
282+ "name" : " [parameters('qnaMakerWebAppName')]" ,
283+ "hostingEnvironment" : " " ,
284+ "serverFarmId" : " [concat('/subscriptions/', subscription().id,'/resourcegroups/', resourceGroup().name, '/providers/Microsoft.Web/serverfarms/', parameters('appServicePlanName'))]" ,
285+ "siteConfig" : {
286+ "cors" : {
287+ "allowedOrigins" : [
288+ " *"
289+ ]
290+ }
291+ }
292+ },
293+ "dependsOn" : [
294+ " [concat('Microsoft.Web/serverfarms/', parameters('appServicePlanName'))]"
295+ ],
296+ "resources" : [
297+ {
298+ "apiVersion" : " 2016-08-01" ,
299+ "name" : " appsettings" ,
300+ "type" : " config" ,
301+ "dependsOn" : [
302+ " [resourceId('Microsoft.Web/Sites', parameters('qnaMakerWebAppName'))]" ,
303+ " [resourceId('Microsoft.Insights/components', parameters('appInsightsName'))]" ,
304+ " [resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName'))]"
305+ ],
306+ "properties" : {
307+ "AzureSearchName" : " [parameters('qnaMakerSearchName')]" ,
308+ "AzureSearchAdminKey" : " [listAdminKeys(resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName')), '2015-08-19').primaryKey]" ,
309+ "UserAppInsightsKey" : " [reference(resourceId('Microsoft.Insights/components/', parameters('appInsightsName')), '2015-05-01').InstrumentationKey]" ,
310+ "UserAppInsightsName" : " [parameters('appInsightsName')]" ,
311+ "UserAppInsightsAppId" : " [reference(resourceId('Microsoft.Insights/components/', parameters('appInsightsName')), '2015-05-01').AppId]" ,
312+ "PrimaryEndpointKey" : " [concat(parameters('qnaMakerWebAppName'), '-PrimaryEndpointKey')]" ,
313+ "SecondaryEndpointKey" : " [concat(parameters('qnaMakerWebAppName'), '-SecondaryEndpointKey')]" ,
314+ "DefaultAnswer" : " No good match found in KB." ,
315+ "QNAMAKER_EXTENSION_VERSION" : " latest"
316+ }
317+ }
318+ ]
319+ }
320+ ],
321+ "outputs" : {
322+ "appInsights" : {
323+ "type" : " object" ,
324+ "value" : {
325+ "appId" : " [reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).AppId]" ,
326+ "instrumentationKey" : " [reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).InstrumentationKey]"
327+ }
328+ },
329+ "storage" : {
330+ "type" : " object" ,
331+ "value" : {
332+ "connectionString" : " [concat('DefaultEndpointsProtocol=https;AccountName=', variables('cleanStorageAccountName'), ';AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('cleanStorageAccountName')), '2018-07-01').keys[0].value, ';EndpointSuffix=core.windows.net')]" ,
333+ "container" : " transcripts"
334+ }
335+ },
336+ "cosmosDb" : {
337+ "type" : " object" ,
338+ "value" : {
339+ "cosmosDBEndpoint" : " [reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbName'))).documentEndpoint]" ,
340+ "authkey" : " [listKeys(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbName')), '2015-04-08').primaryMasterKey]" ,
341+ "databaseId" : " botstate-db" ,
342+ "collectionId" : " botstate-collection"
343+ }
344+ },
345+ "luis" : {
346+ "type" : " object" ,
347+ "value" : {
348+ "key" : " [listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('luisServiceName')),'2017-04-18').key1]"
349+ }
350+ },
351+ "qnaMaker" : {
352+ "type" : " object" ,
353+ "value" : {
354+ "endpoint" : " [concat('https://', reference(resourceId('Microsoft.Web/sites', parameters('qnaMakerWebAppName'))).hostNames[0])]" ,
355+ "key" : " [listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('qnaMakerServiceName')),'2017-04-18').key1]"
356+ }
357+ },
358+ "contentModerator" : {
359+ "type" : " object" ,
360+ "value" : {
361+ "key" : " [listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('contentModeratorName')),'2017-04-18').key1]"
362+ }
363+ }
364+ }
365+ }
0 commit comments