From 65e8b74f5c0a82e23e4e0ab17d527ac5c94fe24d Mon Sep 17 00:00:00 2001 From: DiegoCardozo94 Date: Tue, 14 May 2019 13:08:00 -0300 Subject: [PATCH] Add template.json and parameters.template.json files --- .../resources/parameters.template.json | 21 + .../deployment/resources/template.json | 365 ++++++++++++++++++ .../resources/parameters.template.json | 21 + .../deployment/resources/template.json | 365 ++++++++++++++++++ 4 files changed, 772 insertions(+) create mode 100644 templates/Virtual-Assistant-Template/typescript/generator-botbuilder-assistant/generators/app/templates/customAssistant/deployment/resources/parameters.template.json create mode 100644 templates/Virtual-Assistant-Template/typescript/generator-botbuilder-assistant/generators/app/templates/customAssistant/deployment/resources/template.json create mode 100644 templates/Virtual-Assistant-Template/typescript/samples/sample-assistant/deployment/resources/parameters.template.json create mode 100644 templates/Virtual-Assistant-Template/typescript/samples/sample-assistant/deployment/resources/template.json diff --git a/templates/Virtual-Assistant-Template/typescript/generator-botbuilder-assistant/generators/app/templates/customAssistant/deployment/resources/parameters.template.json b/templates/Virtual-Assistant-Template/typescript/generator-botbuilder-assistant/generators/app/templates/customAssistant/deployment/resources/parameters.template.json new file mode 100644 index 0000000000..b3a214771c --- /dev/null +++ b/templates/Virtual-Assistant-Template/typescript/generator-botbuilder-assistant/generators/app/templates/customAssistant/deployment/resources/parameters.template.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appInsightsLocation": { + "value": "westus2" + }, + "contentModeratorLocation": { + "value": "westus" + }, + "luisServiceLocation": { + "value": "westus" + }, + "qnaServiceLocation": { + "value": "westus" + }, + "qnaMakerSearchSku": { + "value": "basic" + } + } +} \ No newline at end of file diff --git a/templates/Virtual-Assistant-Template/typescript/generator-botbuilder-assistant/generators/app/templates/customAssistant/deployment/resources/template.json b/templates/Virtual-Assistant-Template/typescript/generator-botbuilder-assistant/generators/app/templates/customAssistant/deployment/resources/template.json new file mode 100644 index 0000000000..33e8b5565e --- /dev/null +++ b/templates/Virtual-Assistant-Template/typescript/generator-botbuilder-assistant/generators/app/templates/customAssistant/deployment/resources/template.json @@ -0,0 +1,365 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "type": "string", + "defaultValue": "[resourceGroup().name]" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "microsoftAppId": { + "type": "string" + }, + "microsoftAppPassword": { + "type": "string" + }, + "cosmosDbName": { + "type": "string", + "defaultValue": "[toLower(parameters('name'))]" + }, + "storageAccountName": { + "type": "string", + "defaultValue": "[toLower(parameters('name'))]" + }, + "appServicePlanName": { + "type": "string", + "defaultValue": "[parameters('name')]" + }, + "appServicePlanSku": { + "type": "object", + "defaultValue": { + "tier": "Standard", + "name": "S1" + } + }, + "appInsightsName": { + "type": "string", + "defaultValue": "[parameters('name')]" + }, + "appInsightsLocation": { + "type": "string", + "defaultValue": "westus2" + }, + "botWebAppName": { + "type": "string", + "defaultValue": "[parameters('name')]" + }, + "botServiceName": { + "type": "string", + "defaultValue": "[parameters('name')]" + }, + "botServiceSku": { + "type": "string", + "defaultValue": "S1" + }, + "contentModeratorName": { + "type": "string", + "defaultValue": "[concat(parameters('name'), '-cm')]" + }, + "contentModeratorSku": { + "type": "string", + "defaultValue": "S0" + }, + "contentModeratorLocation": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "luisServiceName": { + "type": "string", + "defaultValue": "[concat(parameters('name'), '-luis')]" + }, + "luisServiceSku": { + "type": "string", + "defaultValue": "S0" + }, + "luisServiceLocation": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "qnaMakerServiceName": { + "type": "string", + "defaultValue": "[concat(parameters('name'), '-qna')]" + }, + "qnaMakerServiceSku": { + "type": "string", + "defaultValue": "S0" + }, + "qnaServiceLocation": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "qnaMakerSearchName": { + "type": "string", + "defaultValue": "[toLower(concat(parameters('name'), '-search'))]" + }, + "qnaMakerSearchSku": { + "type": "string", + "defaultValue": "basic" + }, + "qnaMakerWebAppName": { + "type": "string", + "defaultValue": "[concat(parameters('name'), '-qnahost')]" + } + }, + "variables": { + "botEndpoint": "[concat('https://', toLower(parameters('botWebAppName')), '.azurewebsites.net/api/messages')]", + "cleanStorageAccountName": "[toLower(take(replace(replace(parameters('storageAccountName'), '-', ''), '_', ''), 24))]" + }, + "resources": [ + { + "apiVersion": "2018-02-01", + "name": "3822b5f4-d098-4b57-9ee6-3bee686aec4c", + "type": "Microsoft.Resources/deployments", + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [] + } + } + }, + { + "comments": "CosmosDB for bot state.", + "type": "Microsoft.DocumentDB/databaseAccounts", + "kind": "GlobalDocumentDB", + "apiVersion": "2015-04-08", + "name": "[parameters('cosmosDbName')]", + "location": "[parameters('location')]", + "properties": { + "databaseAccountOfferType": "Standard", + "locations": [ + { + "locationName": "[parameters('location')]", + "failoverPriority": 0 + } + ] + } + }, + { + "comments": "storage account", + "type": "Microsoft.Storage/storageAccounts", + "kind": "StorageV2", + "apiVersion": "2018-07-01", + "name": "[variables('cleanStorageAccountName')]", + "location": "[parameters('location')]", + "sku": { + "name": "Standard_LRS" + } + }, + { + "comments": "app service plan", + "type": "Microsoft.Web/serverFarms", + "apiVersion": "2018-02-01", + "name": "[parameters('appServicePlanName')]", + "location": "[parameters('location')]", + "sku": "[parameters('appServicePlanSku')]", + "properties": {} + }, + { + "comments": "app insights", + "type": "Microsoft.Insights/components", + "kind": "web", + "apiVersion": "2015-05-01", + "name": "[parameters('appInsightsName')]", + "location": "[parameters('appInsightsLocation')]", + "properties": { + "Application_Type": "web" + } + }, + { + "comments": "bot web app", + "type": "Microsoft.Web/sites", + "apiVersion": "2018-02-01", + "name": "[parameters('botWebAppName')]", + "location": "[parameters('location')]", + "properties": { + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]", + "siteConfig": { + "appSettings": [ + { + "name": "MicrosoftAppId", + "value": "[parameters('microsoftAppId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('microsoftAppPassword')]" + } + ] + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]" + ] + }, + { + "comments": "bot service", + "type": "Microsoft.BotService/botServices", + "kind": "sdk", + "apiVersion": "2018-07-12", + "name": "[parameters('botServiceName')]", + "location": "global", + "sku": { + "name": "[parameters('botServiceSku')]" + }, + "properties": { + "displayName": "[parameters('botServiceName')]", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('microsoftAppId')]", + "developerAppInsightKey": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).InstrumentationKey]", + "developerAppInsightsApplicationId": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).ApplicationId]" + } + }, + { + "comments": "Content Moderator service for detecting PII and racy content.", + "type": "Microsoft.CognitiveServices/accounts", + "kind": "ContentModerator", + "apiVersion": "2017-04-18", + "name": "[parameters('contentModeratorName')]", + "location": "[parameters('contentModeratorLocation')]", + "sku": { + "name": "[parameters('contentModeratorSku')]" + } + }, + { + "comments": "Cognitive service key for all LUIS apps.", + "type": "Microsoft.CognitiveServices/accounts", + "kind": "LUIS", + "apiVersion": "2017-04-18", + "name": "[parameters('luisServiceName')]", + "location": "[parameters('luisServiceLocation')]", + "sku": { + "name": "[parameters('luisServiceSku')]" + } + }, + { + "comments": "Cognitive service key for all QnA Maker knowledgebases.", + "type": "Microsoft.CognitiveServices/accounts", + "kind": "QnAMaker", + "apiVersion": "2017-04-18", + "name": "[parameters('qnaMakerServiceName')]", + "location": "[parameters('qnaServiceLocation')]", + "sku": { + "name": "[parameters('qnaMakerServiceSku')]" + }, + "properties": { + "apiProperties": { + "qnaRuntimeEndpoint": "[concat('https://',reference(resourceId('Microsoft.Web/sites', parameters('qnaMakerWebAppName'))).hostNames[0])]" + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', parameters('qnaMakerWebAppName'))]", + "[resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName'))]", + "[resourceId('microsoft.insights/components/', parameters('appInsightsName'))]" + ] + }, + { + "comments": "Search service for QnA Maker service.", + "type": "Microsoft.Search/searchServices", + "apiVersion": "2015-08-19", + "name": "[parameters('qnaMakerSearchName')]", + "location": "[parameters('qnaServiceLocation')]", + "sku": { + "name": "[parameters('qnaMakerSearchSku')]" + }, + "properties": { + "replicaCount": 1, + "partitionCount": 1, + "hostingMode": "default" + } + }, + { + "comments": "Web app for QnA Maker service.", + "type": "Microsoft.Web/sites", + "apiVersion": "2016-08-01", + "name": "[parameters('qnaMakerWebAppName')]", + "location": "[parameters('qnaServiceLocation')]", + "properties": { + "enabled": true, + "name": "[parameters('qnaMakerWebAppName')]", + "hostingEnvironment": "", + "serverFarmId": "[concat('/subscriptions/', subscription().id,'/resourcegroups/', resourceGroup().name, '/providers/Microsoft.Web/serverfarms/', parameters('appServicePlanName'))]", + "siteConfig": { + "cors": { + "allowedOrigins": [ + "*" + ] + } + } + }, + "dependsOn": [ + "[concat('Microsoft.Web/serverfarms/', parameters('appServicePlanName'))]" + ], + "resources": [ + { + "apiVersion": "2016-08-01", + "name": "appsettings", + "type": "config", + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', parameters('qnaMakerWebAppName'))]", + "[resourceId('Microsoft.Insights/components', parameters('appInsightsName'))]", + "[resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName'))]" + ], + "properties": { + "AzureSearchName": "[parameters('qnaMakerSearchName')]", + "AzureSearchAdminKey": "[listAdminKeys(resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName')), '2015-08-19').primaryKey]", + "UserAppInsightsKey": "[reference(resourceId('Microsoft.Insights/components/', parameters('appInsightsName')), '2015-05-01').InstrumentationKey]", + "UserAppInsightsName": "[parameters('appInsightsName')]", + "UserAppInsightsAppId": "[reference(resourceId('Microsoft.Insights/components/', parameters('appInsightsName')), '2015-05-01').AppId]", + "PrimaryEndpointKey": "[concat(parameters('qnaMakerWebAppName'), '-PrimaryEndpointKey')]", + "SecondaryEndpointKey": "[concat(parameters('qnaMakerWebAppName'), '-SecondaryEndpointKey')]", + "DefaultAnswer": "No good match found in KB.", + "QNAMAKER_EXTENSION_VERSION": "latest" + } + } + ] + } + ], + "outputs": { + "appInsights": { + "type": "object", + "value": { + "appId": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).AppId]", + "instrumentationKey": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).InstrumentationKey]" + } + }, + "storage": { + "type": "object", + "value": { + "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')]", + "container": "transcripts" + } + }, + "cosmosDb": { + "type": "object", + "value": { + "cosmosDBEndpoint": "[reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbName'))).documentEndpoint]", + "authkey": "[listKeys(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbName')), '2015-04-08').primaryMasterKey]", + "databaseId": "botstate-db", + "collectionId": "botstate-collection" + } + }, + "luis": { + "type": "object", + "value": { + "key": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('luisServiceName')),'2017-04-18').key1]" + } + }, + "qnaMaker": { + "type": "object", + "value": { + "endpoint": "[concat('https://', reference(resourceId('Microsoft.Web/sites', parameters('qnaMakerWebAppName'))).hostNames[0])]", + "key": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('qnaMakerServiceName')),'2017-04-18').key1]" + } + }, + "contentModerator": { + "type": "object", + "value": { + "key": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('contentModeratorName')),'2017-04-18').key1]" + } + } + } + } \ No newline at end of file diff --git a/templates/Virtual-Assistant-Template/typescript/samples/sample-assistant/deployment/resources/parameters.template.json b/templates/Virtual-Assistant-Template/typescript/samples/sample-assistant/deployment/resources/parameters.template.json new file mode 100644 index 0000000000..b3a214771c --- /dev/null +++ b/templates/Virtual-Assistant-Template/typescript/samples/sample-assistant/deployment/resources/parameters.template.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "appInsightsLocation": { + "value": "westus2" + }, + "contentModeratorLocation": { + "value": "westus" + }, + "luisServiceLocation": { + "value": "westus" + }, + "qnaServiceLocation": { + "value": "westus" + }, + "qnaMakerSearchSku": { + "value": "basic" + } + } +} \ No newline at end of file diff --git a/templates/Virtual-Assistant-Template/typescript/samples/sample-assistant/deployment/resources/template.json b/templates/Virtual-Assistant-Template/typescript/samples/sample-assistant/deployment/resources/template.json new file mode 100644 index 0000000000..33e8b5565e --- /dev/null +++ b/templates/Virtual-Assistant-Template/typescript/samples/sample-assistant/deployment/resources/template.json @@ -0,0 +1,365 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json", + "contentVersion": "1.0.0.0", + "parameters": { + "name": { + "type": "string", + "defaultValue": "[resourceGroup().name]" + }, + "location": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "microsoftAppId": { + "type": "string" + }, + "microsoftAppPassword": { + "type": "string" + }, + "cosmosDbName": { + "type": "string", + "defaultValue": "[toLower(parameters('name'))]" + }, + "storageAccountName": { + "type": "string", + "defaultValue": "[toLower(parameters('name'))]" + }, + "appServicePlanName": { + "type": "string", + "defaultValue": "[parameters('name')]" + }, + "appServicePlanSku": { + "type": "object", + "defaultValue": { + "tier": "Standard", + "name": "S1" + } + }, + "appInsightsName": { + "type": "string", + "defaultValue": "[parameters('name')]" + }, + "appInsightsLocation": { + "type": "string", + "defaultValue": "westus2" + }, + "botWebAppName": { + "type": "string", + "defaultValue": "[parameters('name')]" + }, + "botServiceName": { + "type": "string", + "defaultValue": "[parameters('name')]" + }, + "botServiceSku": { + "type": "string", + "defaultValue": "S1" + }, + "contentModeratorName": { + "type": "string", + "defaultValue": "[concat(parameters('name'), '-cm')]" + }, + "contentModeratorSku": { + "type": "string", + "defaultValue": "S0" + }, + "contentModeratorLocation": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "luisServiceName": { + "type": "string", + "defaultValue": "[concat(parameters('name'), '-luis')]" + }, + "luisServiceSku": { + "type": "string", + "defaultValue": "S0" + }, + "luisServiceLocation": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "qnaMakerServiceName": { + "type": "string", + "defaultValue": "[concat(parameters('name'), '-qna')]" + }, + "qnaMakerServiceSku": { + "type": "string", + "defaultValue": "S0" + }, + "qnaServiceLocation": { + "type": "string", + "defaultValue": "[resourceGroup().location]" + }, + "qnaMakerSearchName": { + "type": "string", + "defaultValue": "[toLower(concat(parameters('name'), '-search'))]" + }, + "qnaMakerSearchSku": { + "type": "string", + "defaultValue": "basic" + }, + "qnaMakerWebAppName": { + "type": "string", + "defaultValue": "[concat(parameters('name'), '-qnahost')]" + } + }, + "variables": { + "botEndpoint": "[concat('https://', toLower(parameters('botWebAppName')), '.azurewebsites.net/api/messages')]", + "cleanStorageAccountName": "[toLower(take(replace(replace(parameters('storageAccountName'), '-', ''), '_', ''), 24))]" + }, + "resources": [ + { + "apiVersion": "2018-02-01", + "name": "3822b5f4-d098-4b57-9ee6-3bee686aec4c", + "type": "Microsoft.Resources/deployments", + "properties": { + "mode": "Incremental", + "template": { + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [] + } + } + }, + { + "comments": "CosmosDB for bot state.", + "type": "Microsoft.DocumentDB/databaseAccounts", + "kind": "GlobalDocumentDB", + "apiVersion": "2015-04-08", + "name": "[parameters('cosmosDbName')]", + "location": "[parameters('location')]", + "properties": { + "databaseAccountOfferType": "Standard", + "locations": [ + { + "locationName": "[parameters('location')]", + "failoverPriority": 0 + } + ] + } + }, + { + "comments": "storage account", + "type": "Microsoft.Storage/storageAccounts", + "kind": "StorageV2", + "apiVersion": "2018-07-01", + "name": "[variables('cleanStorageAccountName')]", + "location": "[parameters('location')]", + "sku": { + "name": "Standard_LRS" + } + }, + { + "comments": "app service plan", + "type": "Microsoft.Web/serverFarms", + "apiVersion": "2018-02-01", + "name": "[parameters('appServicePlanName')]", + "location": "[parameters('location')]", + "sku": "[parameters('appServicePlanSku')]", + "properties": {} + }, + { + "comments": "app insights", + "type": "Microsoft.Insights/components", + "kind": "web", + "apiVersion": "2015-05-01", + "name": "[parameters('appInsightsName')]", + "location": "[parameters('appInsightsLocation')]", + "properties": { + "Application_Type": "web" + } + }, + { + "comments": "bot web app", + "type": "Microsoft.Web/sites", + "apiVersion": "2018-02-01", + "name": "[parameters('botWebAppName')]", + "location": "[parameters('location')]", + "properties": { + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]", + "siteConfig": { + "appSettings": [ + { + "name": "MicrosoftAppId", + "value": "[parameters('microsoftAppId')]" + }, + { + "name": "MicrosoftAppPassword", + "value": "[parameters('microsoftAppPassword')]" + } + ] + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]" + ] + }, + { + "comments": "bot service", + "type": "Microsoft.BotService/botServices", + "kind": "sdk", + "apiVersion": "2018-07-12", + "name": "[parameters('botServiceName')]", + "location": "global", + "sku": { + "name": "[parameters('botServiceSku')]" + }, + "properties": { + "displayName": "[parameters('botServiceName')]", + "endpoint": "[variables('botEndpoint')]", + "msaAppId": "[parameters('microsoftAppId')]", + "developerAppInsightKey": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).InstrumentationKey]", + "developerAppInsightsApplicationId": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).ApplicationId]" + } + }, + { + "comments": "Content Moderator service for detecting PII and racy content.", + "type": "Microsoft.CognitiveServices/accounts", + "kind": "ContentModerator", + "apiVersion": "2017-04-18", + "name": "[parameters('contentModeratorName')]", + "location": "[parameters('contentModeratorLocation')]", + "sku": { + "name": "[parameters('contentModeratorSku')]" + } + }, + { + "comments": "Cognitive service key for all LUIS apps.", + "type": "Microsoft.CognitiveServices/accounts", + "kind": "LUIS", + "apiVersion": "2017-04-18", + "name": "[parameters('luisServiceName')]", + "location": "[parameters('luisServiceLocation')]", + "sku": { + "name": "[parameters('luisServiceSku')]" + } + }, + { + "comments": "Cognitive service key for all QnA Maker knowledgebases.", + "type": "Microsoft.CognitiveServices/accounts", + "kind": "QnAMaker", + "apiVersion": "2017-04-18", + "name": "[parameters('qnaMakerServiceName')]", + "location": "[parameters('qnaServiceLocation')]", + "sku": { + "name": "[parameters('qnaMakerServiceSku')]" + }, + "properties": { + "apiProperties": { + "qnaRuntimeEndpoint": "[concat('https://',reference(resourceId('Microsoft.Web/sites', parameters('qnaMakerWebAppName'))).hostNames[0])]" + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', parameters('qnaMakerWebAppName'))]", + "[resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName'))]", + "[resourceId('microsoft.insights/components/', parameters('appInsightsName'))]" + ] + }, + { + "comments": "Search service for QnA Maker service.", + "type": "Microsoft.Search/searchServices", + "apiVersion": "2015-08-19", + "name": "[parameters('qnaMakerSearchName')]", + "location": "[parameters('qnaServiceLocation')]", + "sku": { + "name": "[parameters('qnaMakerSearchSku')]" + }, + "properties": { + "replicaCount": 1, + "partitionCount": 1, + "hostingMode": "default" + } + }, + { + "comments": "Web app for QnA Maker service.", + "type": "Microsoft.Web/sites", + "apiVersion": "2016-08-01", + "name": "[parameters('qnaMakerWebAppName')]", + "location": "[parameters('qnaServiceLocation')]", + "properties": { + "enabled": true, + "name": "[parameters('qnaMakerWebAppName')]", + "hostingEnvironment": "", + "serverFarmId": "[concat('/subscriptions/', subscription().id,'/resourcegroups/', resourceGroup().name, '/providers/Microsoft.Web/serverfarms/', parameters('appServicePlanName'))]", + "siteConfig": { + "cors": { + "allowedOrigins": [ + "*" + ] + } + } + }, + "dependsOn": [ + "[concat('Microsoft.Web/serverfarms/', parameters('appServicePlanName'))]" + ], + "resources": [ + { + "apiVersion": "2016-08-01", + "name": "appsettings", + "type": "config", + "dependsOn": [ + "[resourceId('Microsoft.Web/Sites', parameters('qnaMakerWebAppName'))]", + "[resourceId('Microsoft.Insights/components', parameters('appInsightsName'))]", + "[resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName'))]" + ], + "properties": { + "AzureSearchName": "[parameters('qnaMakerSearchName')]", + "AzureSearchAdminKey": "[listAdminKeys(resourceId('Microsoft.Search/searchServices/', parameters('qnaMakerSearchName')), '2015-08-19').primaryKey]", + "UserAppInsightsKey": "[reference(resourceId('Microsoft.Insights/components/', parameters('appInsightsName')), '2015-05-01').InstrumentationKey]", + "UserAppInsightsName": "[parameters('appInsightsName')]", + "UserAppInsightsAppId": "[reference(resourceId('Microsoft.Insights/components/', parameters('appInsightsName')), '2015-05-01').AppId]", + "PrimaryEndpointKey": "[concat(parameters('qnaMakerWebAppName'), '-PrimaryEndpointKey')]", + "SecondaryEndpointKey": "[concat(parameters('qnaMakerWebAppName'), '-SecondaryEndpointKey')]", + "DefaultAnswer": "No good match found in KB.", + "QNAMAKER_EXTENSION_VERSION": "latest" + } + } + ] + } + ], + "outputs": { + "appInsights": { + "type": "object", + "value": { + "appId": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).AppId]", + "instrumentationKey": "[reference(resourceId('Microsoft.Insights/components', parameters('appInsightsName'))).InstrumentationKey]" + } + }, + "storage": { + "type": "object", + "value": { + "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')]", + "container": "transcripts" + } + }, + "cosmosDb": { + "type": "object", + "value": { + "cosmosDBEndpoint": "[reference(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbName'))).documentEndpoint]", + "authkey": "[listKeys(resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('cosmosDbName')), '2015-04-08').primaryMasterKey]", + "databaseId": "botstate-db", + "collectionId": "botstate-collection" + } + }, + "luis": { + "type": "object", + "value": { + "key": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('luisServiceName')),'2017-04-18').key1]" + } + }, + "qnaMaker": { + "type": "object", + "value": { + "endpoint": "[concat('https://', reference(resourceId('Microsoft.Web/sites', parameters('qnaMakerWebAppName'))).hostNames[0])]", + "key": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('qnaMakerServiceName')),'2017-04-18').key1]" + } + }, + "contentModerator": { + "type": "object", + "value": { + "key": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('contentModeratorName')),'2017-04-18').key1]" + } + } + } + } \ No newline at end of file