Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"name": {
"type": "string",
"defaultValue": "[resourceGroup().name]"
},
"newAppServicePlanName": {
"type": "string",
"defaultValue": "[resourceGroup().name]",
"metadata": {
"description": "The name of the new App Service Plan."
}
},
"newAppServicePlanSku": {
"type": "object",
"defaultValue": {
"name": "S1",
"tier": "Standard",
"size": "S1",
"family": "S",
"capacity": 1
},
"metadata": {
"description": "The SKU of the App Service Plan. Defaults to Standard values."
}
},
"appServicePlanLocation": {
"type": "string",
"metadata": {
"description": "The location of the App Service Plan."
}
},
"existingAppServicePlan": {
"type": "string",
"defaultValue": "",
"metadata": {
"description": "Name of the existing App Service Plan used to create the Web App for the bot."
}
},
"appInsightsName": {
"type": "string",
"defaultValue": "[resourceGroup().name]"
},
"appInsightsLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"qnaMakerServiceName": {
"type": "string",
"defaultValue": "[concat(parameters('name'), '-qna')]"
},
"qnaMakerServiceSku": {
"type": "string",
"defaultValue": "S0"
},
"qnaMakerServiceLocation": {
"type": "string",
"defaultValue": "westus"
},
"qnaMakerSearchName": {
"type": "string",
"defaultValue": "[concat(parameters('name'), '-search')]"
},
"qnaMakerSearchSku": {
"type": "string",
"defaultValue": "standard"
},
"qnaMakerSearchLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"qnaMakerWebAppName": {
"type": "string",
"defaultValue": "[concat(parameters('name'), '-qnahost')]"
},
"qnaMakerWebAppLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
}
},
"variables": {
"defaultAppServicePlanName": "[if(empty(parameters('existingAppServicePlan')), 'createNewAppServicePlan', parameters('existingAppServicePlan'))]",
"useExistingAppServicePlan": "[not(equals(variables('defaultAppServicePlanName'), 'createNewAppServicePlan'))]",
"servicePlanName": "[if(variables('useExistingAppServicePlan'), parameters('existingAppServicePlan'), parameters('newAppServicePlanName'))]",
"resourcesLocation": "[parameters('appServicePlanLocation')]",
"qnaMakerSearchName": "[toLower(replace(parameters('qnaMakerSearchName'), '_', ''))]",
"qnaMakerWebAppName": "[replace(parameters('qnaMakerWebAppName'), '_', '')]"
},
"resources": [
{
"apiVersion": "2018-02-01",
"name": "1d41002f-62a1-49f3-bd43-2f3f32a19cbb",
"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": "Create a new App Service Plan if no existing App Service Plan name was passed in.",
"type": "Microsoft.Web/serverfarms",
"condition": "[not(variables('useExistingAppServicePlan'))]",
"name": "[variables('servicePlanName')]",
"apiVersion": "2018-02-01",
"location": "[variables('resourcesLocation')]",
"sku": "[parameters('newAppServicePlanSku')]",
"properties": {
"name": "[variables('servicePlanName')]"
}
},
{
"comments": "app insights",
"type": "Microsoft.Insights/components",
"kind": "web",
"apiVersion": "2015-05-01",
"name": "[parameters('appInsightsName')]",
"location": "[parameters('appInsightsLocation')]",
"properties": {
"Application_Type": "web"
}
},
{
"comments": "Cognitive service key for all QnA Maker knowledgebases.",
"type": "Microsoft.CognitiveServices/accounts",
"kind": "QnAMaker",
"apiVersion": "2017-04-18",
"name": "[parameters('qnaMakerServiceName')]",
"location": "[parameters('qnaMakerServiceLocation')]",
"sku": {
"name": "[parameters('qnaMakerServiceSku')]"
},
"properties": {
"apiProperties": {
"qnaRuntimeEndpoint": "[concat('https://',reference(resourceId('Microsoft.Web/sites', variables('qnaMakerWebAppName'))).hostNames[0])]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('qnaMakerWebAppName'))]",
"[resourceId('Microsoft.Search/searchServices/', variables('qnaMakerSearchName'))]",
"[resourceId('microsoft.insights/components/', parameters('appInsightsName'))]"
]
},
{
"comments": "Search service for QnA Maker service.",
"type": "Microsoft.Search/searchServices",
"apiVersion": "2015-08-19",
"name": "[variables('qnaMakerSearchName')]",
"location": "[parameters('qnaMakerSearchLocation')]",
"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": "[variables('qnaMakerWebAppName')]",
"location": "[parameters('qnaMakerWebAppLocation')]",
"properties": {
"enabled": true,
"name": "[variables('qnaMakerWebAppName')]",
"hostingEnvironment": "",
"serverFarmId": "[concat('/subscriptions/', Subscription().SubscriptionId,'/resourcegroups/', resourceGroup().name, '/providers/Microsoft.Web/serverfarms/', variables('servicePlanName'))]",
"siteConfig": {
"cors": {
"allowedOrigins": [
"*"
]
}
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms/', variables('servicePlanName'))]"
],
"resources": [
{
"apiVersion": "2016-08-01",
"name": "appsettings",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('qnaMakerWebAppName'))]",
"[resourceId('Microsoft.Insights/components', parameters('appInsightsName'))]",
"[resourceId('Microsoft.Search/searchServices/', variables('qnaMakerSearchName'))]"
],
"properties": {
"AzureSearchName": "[variables('qnaMakerSearchName')]",
"AzureSearchAdminKey": "[listAdminKeys(resourceId('Microsoft.Search/searchServices/', variables('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(variables('qnaMakerWebAppName'), '-PrimaryEndpointKey')]",
"SecondaryEndpointKey": "[concat(variables('qnaMakerWebAppName'), '-SecondaryEndpointKey')]",
"DefaultAnswer": "No good match found in KB.",
"QNAMAKER_EXTENSION_VERSION": "latest"
}
}
]
}
],
"outputs": {
"qna": {
"type": "object",
"value": {
"endpoint": "[concat('https://', reference(resourceId('Microsoft.Web/sites', variables('qnaMakerWebAppName'))).hostNames[0])]",
"subscriptionKey": "[listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('qnaMakerServiceName')),'2017-04-18').key1]"
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
"type": "bool",
"defaultValue": true
},
"shouldCreateQnAResource": {
"type": "bool",
"defaultValue": true
},
"cosmosDbName": {
"type": "string",
"defaultValue": "[resourceGroup().name]"
Expand Down Expand Up @@ -134,38 +130,6 @@
"luisServiceLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"qnaMakerServiceName": {
"type": "string",
"defaultValue": "[concat(parameters('name'), '-qna')]"
},
"qnaMakerServiceSku": {
"type": "string",
"defaultValue": "S0"
},
"qnaMakerServiceLocation": {
"type": "string",
"defaultValue": "westus"
},
"qnaMakerSearchName": {
"type": "string",
"defaultValue": "[concat(parameters('name'), '-search')]"
},
"qnaMakerSearchSku": {
"type": "string",
"defaultValue": "standard"
},
"qnaMakerSearchLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"qnaMakerWebAppName": {
"type": "string",
"defaultValue": "[concat(parameters('name'), '-qnahost')]"
},
"qnaMakerWebAppLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
}
},
"variables": {
Expand All @@ -178,9 +142,7 @@
"siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]",
"botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]",
"storageAccountName": "[toLower(take(replace(replace(parameters('storageAccountName'), '-', ''), '_', ''), 24))]",
"LuisAuthoringAccountName": "[concat(parameters('luisServiceName'), '-Authoring')]",
"qnaMakerSearchName": "[toLower(replace(parameters('qnaMakerSearchName'), '_', ''))]",
"qnaMakerWebAppName": "[replace(parameters('qnaMakerWebAppName'), '_', '')]"
"LuisAuthoringAccountName": "[concat(parameters('luisServiceName'), '-Authoring')]"
},
"resources": [
{
Expand Down Expand Up @@ -388,92 +350,6 @@
"name": "[parameters('luisServiceRunTimeSku')]"
},
"condition": "[parameters('shouldCreateLuisResource')]"
},
{
"comments": "Cognitive service key for all QnA Maker knowledgebases.",
"type": "Microsoft.CognitiveServices/accounts",
"kind": "QnAMaker",
"apiVersion": "2017-04-18",
"name": "[parameters('qnaMakerServiceName')]",
"location": "[parameters('qnaMakerServiceLocation')]",
"sku": {
"name": "[parameters('qnaMakerServiceSku')]"
},
"properties": {
"apiProperties": {
"qnaRuntimeEndpoint": "[concat('https://',reference(resourceId('Microsoft.Web/sites', variables('qnaMakerWebAppName'))).hostNames[0])]"
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('qnaMakerWebAppName'))]",
"[resourceId('Microsoft.Search/searchServices/', variables('qnaMakerSearchName'))]",
"[resourceId('microsoft.insights/components/', parameters('appInsightsName'))]"
],
"condition": "[parameters('shouldCreateQnAResource')]"
},
{
"comments": "Search service for QnA Maker service.",
"type": "Microsoft.Search/searchServices",
"apiVersion": "2015-08-19",
"name": "[variables('qnaMakerSearchName')]",
"location": "[parameters('qnaMakerSearchLocation')]",
"sku": {
"name": "[parameters('qnaMakerSearchSku')]"
},
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"hostingMode": "default"
},
"condition": "[parameters('shouldCreateQnAResource')]"
},
{
"comments": "Web app for QnA Maker service.",
"type": "Microsoft.Web/sites",
"apiVersion": "2016-08-01",
"name": "[variables('qnaMakerWebAppName')]",
"location": "[parameters('qnaMakerWebAppLocation')]",
"properties": {
"enabled": true,
"name": "[variables('qnaMakerWebAppName')]",
"hostingEnvironment": "",
"serverFarmId": "[concat('/subscriptions/', Subscription().SubscriptionId,'/resourcegroups/', resourceGroup().name, '/providers/Microsoft.Web/serverfarms/', variables('servicePlanName'))]",
"siteConfig": {
"cors": {
"allowedOrigins": [
"*"
]
}
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms/', variables('servicePlanName'))]"
],
"condition": "[parameters('shouldCreateQnAResource')]",
"resources": [
{
"apiVersion": "2016-08-01",
"name": "appsettings",
"type": "config",
"dependsOn": [
"[resourceId('Microsoft.Web/Sites', variables('qnaMakerWebAppName'))]",
"[resourceId('Microsoft.Insights/components', parameters('appInsightsName'))]",
"[resourceId('Microsoft.Search/searchServices/', variables('qnaMakerSearchName'))]"
],
"properties": {
"AzureSearchName": "[variables('qnaMakerSearchName')]",
"AzureSearchAdminKey": "[listAdminKeys(resourceId('Microsoft.Search/searchServices/', variables('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(variables('qnaMakerWebAppName'), '-PrimaryEndpointKey')]",
"SecondaryEndpointKey": "[concat(variables('qnaMakerWebAppName'), '-SecondaryEndpointKey')]",
"DefaultAnswer": "No good match found in KB.",
"QNAMAKER_EXTENSION_VERSION": "latest"
},
"condition": "[parameters('shouldCreateQnAResource')]"
}
]
}
],
"outputs": {
Expand Down Expand Up @@ -509,13 +385,6 @@
"endpoint": "[if(parameters('shouldCreateLuisResource'), reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('luisServiceName'))).endpoint, '')]",
"authoringEndpoint": "[if(parameters('shouldCreateAuthoringResource'), reference(resourceId('Microsoft.CognitiveServices/accounts', variables('LuisAuthoringAccountName'))).endpoint, '')]"
}
},
"qna": {
"type": "object",
"value": {
"endpoint": "[if(parameters('shouldCreateQnAResource'), concat('https://', reference(resourceId('Microsoft.Web/sites', variables('qnaMakerWebAppName'))).hostNames[0]), '')]",
"subscriptionKey": "[if(parameters('shouldCreateQnAResource'), listKeys(resourceId('Microsoft.CognitiveServices/accounts', parameters('qnaMakerServiceName')),'2017-04-18').key1, '')]"
}
}
}
}
Loading