diff --git a/samples/11.qnamaker/LICENSE b/samples/11.qnamaker/LICENSE
new file mode 100644
index 00000000..21071075
--- /dev/null
+++ b/samples/11.qnamaker/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
diff --git a/samples/11.qnamaker/README.md b/samples/11.qnamaker/README.md
new file mode 100644
index 00000000..7a82c0e3
--- /dev/null
+++ b/samples/11.qnamaker/README.md
@@ -0,0 +1,64 @@
+# QnA Maker
+
+Bot Framework v4 QnA Maker bot sample
+
+This bot has been created using [Bot Framework](https://dev.botframework.com), it shows how to create a bot that uses the [QnA Maker Cognitive AI](https://www.qnamaker.ai) service.
+
+The [QnA Maker Service](https://www.qnamaker.ai) enables you to build, train and publish a simple question and answer bot based on FAQ URLs, structured documents or editorial content in minutes. In this sample, we demonstrate how to use the QnA Maker service to answer questions based on a FAQ text file used as input.
+
+## Prerequisites
+
+This samples **requires** prerequisites in order to run.
+
+### Overview
+
+- This bot uses [QnA Maker Service](https://www.qnamaker.ai), an AI based cognitive service, to implement simple Question and Answer conversational patterns.
+- Java 1.8+
+- Install [Maven](https://maven.apache.org/)
+- An account on [Azure](https://azure.microsoft.com) if you want to deploy to Azure.
+
+### Create a QnAMaker Application to enable QnA Knowledge Bases
+
+QnA knowledge base setup and application configuration steps can be found [here](https://aka.ms/qna-instructions).
+
+## To try this sample
+
+- From the root of this project folder:
+ - Build the sample using `mvn package`
+ - Run it by using `java -jar .\target\bot-qna-sample.jar`
+
+## Testing the bot using Bot Framework Emulator
+
+[Bot Framework Emulator](https://github.com/microsoft/botframework-emulator) is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.
+
+- Install the latest Bot Framework Emulator from [here](https://github.com/Microsoft/BotFramework-Emulator/releases)
+
+### Connect to the bot using Bot Framework Emulator
+
+- Launch Bot Framework Emulator
+- File -> Open Bot
+- Enter a Bot URL of `http://localhost:3978/api/messages`
+
+## Interacting with the bot
+
+QnA Maker enables you to power a question and answer service from your semi-structured content.
+
+One of the basic requirements in writing your own bot is to seed it with questions and answers. In many cases, the questions and answers already exist in content like FAQ URLs/documents, product manuals, etc. With QnA Maker, users can query your application in a natural, conversational manner. QnA Maker uses machine learning to extract relevant question-answer pairs from your content. It also uses powerful matching and ranking algorithms to provide the best possible match between the user query and the questions.
+
+## Deploy the bot to Azure
+
+To learn more about deploying a bot to Azure, see [Deploy your bot to Azure](https://aka.ms/azuredeployment) for a complete list of deployment instructions.
+
+## Further reading
+
+- [Bot Framework Documentation](https://docs.botframework.com)
+- [Bot Basics](https://docs.microsoft.com/azure/bot-service/bot-builder-basics?view=azure-bot-service-4.0)
+- [QnA Maker Documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/qnamaker/overview/overview)
+- [Activity processing](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-concept-activity-processing?view=azure-bot-service-4.0)
+- [Azure Bot Service Introduction](https://docs.microsoft.com/azure/bot-service/bot-service-overview-introduction?view=azure-bot-service-4.0)
+- [Azure Bot Service Documentation](https://docs.microsoft.com/azure/bot-service/?view=azure-bot-service-4.0)
+- [Azure CLI](https://docs.microsoft.com/cli/azure/?view=azure-cli-latest)
+- [QnA Maker CLI](https://github.com/microsoft/botframework-cli/tree/main/packages/qnamaker)
+- [Azure Portal](https://portal.azure.com)
+- [Channels and Bot Connector Service](https://docs.microsoft.com/en-us/azure/bot-service/bot-concepts?view=azure-bot-service-4.0)
+- [Spring Boot](https://spring.io/projects/spring-boot)
diff --git a/samples/11.qnamaker/deploymentTemplates/template-with-new-rg.json b/samples/11.qnamaker/deploymentTemplates/template-with-new-rg.json
new file mode 100644
index 00000000..ec2460d3
--- /dev/null
+++ b/samples/11.qnamaker/deploymentTemplates/template-with-new-rg.json
@@ -0,0 +1,291 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "parameters": {
+ "groupLocation": {
+ "defaultValue": "",
+ "type": "string",
+ "metadata": {
+ "description": "Specifies the location of the Resource Group."
+ }
+ },
+ "groupName": {
+ "type": "string",
+ "metadata": {
+ "description": "Specifies the name of the Resource Group."
+ }
+ },
+ "appId": {
+ "type": "string",
+ "metadata": {
+ "description": "Active Directory App ID, set as MicrosoftAppId in the Web App's Application Settings."
+ }
+ },
+ "appSecret": {
+ "type": "string",
+ "metadata": {
+ "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings."
+ }
+ },
+ "botId": {
+ "type": "string",
+ "metadata": {
+ "description": "The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable."
+ }
+ },
+ "botSku": {
+ "defaultValue": "S1",
+ "type": "string",
+ "metadata": {
+ "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1."
+ }
+ },
+ "newAppServicePlanName": {
+ "defaultValue": "",
+ "type": "string",
+ "metadata": {
+ "description": "The name of the App Service Plan."
+ }
+ },
+ "newAppServicePlanSku": {
+ "type": "object",
+ "defaultValue": {
+ "name": "P1v2",
+ "tier": "PremiumV2",
+ "size": "P1v2",
+ "family": "Pv2",
+ "capacity": 1
+ },
+ "metadata": {
+ "description": "The SKU of the App Service Plan. Defaults to Standard values."
+ }
+ },
+ "newAppServicePlanLocation": {
+ "defaultValue": "",
+ "type": "string",
+ "metadata": {
+ "description": "The location of the App Service Plan. Defaults to \"westus\"."
+ }
+ },
+ "newWebAppName": {
+ "type": "string",
+ "defaultValue": "",
+ "metadata": {
+ "description": "The globally unique name of the Web App. Defaults to the value passed in for \"botId\"."
+ }
+ }
+ },
+ "variables": {
+ "appServicePlanName": "[parameters('newAppServicePlanName')]",
+ "resourcesLocation": "[parameters('newAppServicePlanLocation')]",
+ "webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]",
+ "siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]",
+ "botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]",
+ "publishingUsername": "[concat('$', parameters('newWebAppName'))]",
+ "resourceGroupId": "[concat(subscription().id, '/resourceGroups/', parameters('groupName'))]"
+ },
+ "resources": [
+ {
+ "name": "[parameters('groupName')]",
+ "type": "Microsoft.Resources/resourceGroups",
+ "apiVersion": "2018-05-01",
+ "location": "[parameters('groupLocation')]",
+ "properties": {}
+ },
+ {
+ "type": "Microsoft.Resources/deployments",
+ "apiVersion": "2018-05-01",
+ "name": "storageDeployment",
+ "resourceGroup": "[parameters('groupName')]",
+ "dependsOn": [
+ "[resourceId('Microsoft.Resources/resourceGroups/', parameters('groupName'))]"
+ ],
+ "properties": {
+ "mode": "Incremental",
+ "template": {
+ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "parameters": {},
+ "variables": {},
+ "resources": [
+ {
+ "comments": "Create a new Linux App Service Plan if no existing App Service Plan name was passed in.",
+ "type": "Microsoft.Web/serverfarms",
+ "name": "[variables('appServicePlanName')]",
+ "apiVersion": "2018-02-01",
+ "location": "[variables('resourcesLocation')]",
+ "sku": "[parameters('newAppServicePlanSku')]",
+ "kind": "linux",
+ "properties": {
+ "perSiteScaling": false,
+ "maximumElasticWorkerCount": 1,
+ "isSpot": false,
+ "reserved": true,
+ "isXenon": false,
+ "hyperV": false,
+ "targetWorkerCount": 0,
+ "targetWorkerSizeId": 0
+ }
+ },
+ {
+ "comments": "Create a Web App using a Linux App Service Plan",
+ "type": "Microsoft.Web/sites",
+ "apiVersion": "2018-11-01",
+ "location": "[variables('resourcesLocation')]",
+ "kind": "app,linux",
+ "dependsOn": [
+ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/serverfarms/', variables('appServicePlanName'))]"
+ ],
+ "name": "[variables('webAppName')]",
+ "properties": {
+ "name": "[variables('webAppName')]",
+ "hostNameSslStates": [
+ {
+ "name": "[concat(parameters('newWebAppName'), '.azurewebsites.net')]",
+ "sslState": "Disabled",
+ "hostType": "Standard"
+ },
+ {
+ "name": "[concat(parameters('newWebAppName'), '.scm.azurewebsites.net')]",
+ "sslState": "Disabled",
+ "hostType": "Repository"
+ }
+ ],
+ "serverFarmId": "[variables('appServicePlanName')]",
+ "reserved": true,
+ "isXenon": false,
+ "hyperV": false,
+ "scmSiteAlsoStopped": false,
+ "clientAffinityEnabled": true,
+ "clientCertEnabled": false,
+ "hostNamesDisabled": false,
+ "containerSize": 0,
+ "dailyMemoryTimeQuota": 0,
+ "httpsOnly": false,
+ "redundancyMode": "None",
+ "siteConfig": {
+ "appSettings": [
+ {
+ "name": "JAVA_OPTS",
+ "value": "-Dserver.port=80"
+ },
+ {
+ "name": "MicrosoftAppId",
+ "value": "[parameters('appId')]"
+ },
+ {
+ "name": "MicrosoftAppPassword",
+ "value": "[parameters('appSecret')]"
+ }
+ ],
+ "cors": {
+ "allowedOrigins": [
+ "https://botservice.hosting.portal.azure.net",
+ "https://hosting.onecloud.azure-test.net/"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "type": "Microsoft.Web/sites/config",
+ "apiVersion": "2018-11-01",
+ "name": "[concat(variables('webAppName'), '/web')]",
+ "location": "[variables('resourcesLocation')]",
+ "dependsOn": [
+ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', variables('webAppName'))]"
+ ],
+ "properties": {
+ "numberOfWorkers": 1,
+ "defaultDocuments": [
+ "Default.htm",
+ "Default.html",
+ "Default.asp",
+ "index.htm",
+ "index.html",
+ "iisstart.htm",
+ "default.aspx",
+ "index.php",
+ "hostingstart.html"
+ ],
+ "netFrameworkVersion": "v4.0",
+ "linuxFxVersion": "JAVA|8-jre8",
+ "requestTracingEnabled": false,
+ "remoteDebuggingEnabled": false,
+ "httpLoggingEnabled": false,
+ "logsDirectorySizeLimit": 35,
+ "detailedErrorLoggingEnabled": false,
+ "publishingUsername": "[variables('publishingUsername')]",
+ "scmType": "None",
+ "use32BitWorkerProcess": true,
+ "webSocketsEnabled": false,
+ "alwaysOn": true,
+ "managedPipelineMode": "Integrated",
+ "virtualApplications": [
+ {
+ "virtualPath": "/",
+ "physicalPath": "site\\wwwroot",
+ "preloadEnabled": true
+ }
+ ],
+ "loadBalancing": "LeastRequests",
+ "experiments": {
+ "rampUpRules": []
+ },
+ "autoHealEnabled": false,
+ "localMySqlEnabled": false,
+ "ipSecurityRestrictions": [
+ {
+ "ipAddress": "Any",
+ "action": "Allow",
+ "priority": 1,
+ "name": "Allow all",
+ "description": "Allow all access"
+ }
+ ],
+ "scmIpSecurityRestrictions": [
+ {
+ "ipAddress": "Any",
+ "action": "Allow",
+ "priority": 1,
+ "name": "Allow all",
+ "description": "Allow all access"
+ }
+ ],
+ "scmIpSecurityRestrictionsUseMain": false,
+ "http20Enabled": false,
+ "minTlsVersion": "1.2",
+ "ftpsState": "AllAllowed",
+ "reservedInstanceCount": 0
+ }
+ },
+ {
+ "apiVersion": "2017-12-01",
+ "type": "Microsoft.BotService/botServices",
+ "name": "[parameters('botId')]",
+ "location": "global",
+ "kind": "bot",
+ "sku": {
+ "name": "[parameters('botSku')]"
+ },
+ "properties": {
+ "name": "[parameters('botId')]",
+ "displayName": "[parameters('botId')]",
+ "endpoint": "[variables('botEndpoint')]",
+ "msaAppId": "[parameters('appId')]",
+ "developerAppInsightsApplicationId": null,
+ "developerAppInsightKey": null,
+ "publishingCredentials": null,
+ "storageResourceId": null
+ },
+ "dependsOn": [
+ "[concat(variables('resourceGroupId'), '/providers/Microsoft.Web/sites/', variables('webAppName'))]"
+ ]
+ }
+ ],
+ "outputs": {}
+ }
+ }
+ }
+ ]
+}
diff --git a/samples/11.qnamaker/deploymentTemplates/template-with-preexisting-rg.json b/samples/11.qnamaker/deploymentTemplates/template-with-preexisting-rg.json
new file mode 100644
index 00000000..024dcf08
--- /dev/null
+++ b/samples/11.qnamaker/deploymentTemplates/template-with-preexisting-rg.json
@@ -0,0 +1,259 @@
+{
+ "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+ "contentVersion": "1.0.0.0",
+ "parameters": {
+ "appId": {
+ "type": "string",
+ "metadata": {
+ "description": "Active Directory App ID, set as MicrosoftAppId in the Web App's Application Settings."
+ }
+ },
+ "appSecret": {
+ "type": "string",
+ "metadata": {
+ "description": "Active Directory App Password, set as MicrosoftAppPassword in the Web App's Application Settings. Defaults to \"\"."
+ }
+ },
+ "botId": {
+ "type": "string",
+ "metadata": {
+ "description": "The globally unique and immutable bot ID. Also used to configure the displayName of the bot, which is mutable."
+ }
+ },
+ "botSku": {
+ "defaultValue": "S1",
+ "type": "string",
+ "metadata": {
+ "description": "The pricing tier of the Bot Service Registration. Acceptable values are F0 and S1."
+ }
+ },
+ "newAppServicePlanName": {
+ "type": "string",
+ "defaultValue": "",
+ "metadata": {
+ "description": "The name of the new App Service Plan."
+ }
+ },
+ "newAppServicePlanSku": {
+ "type": "object",
+ "defaultValue": {
+ "name": "P1v2",
+ "tier": "PremiumV2",
+ "size": "P1v2",
+ "family": "Pv2",
+ "capacity": 1
+ },
+ "metadata": {
+ "description": "The SKU of the App Service Plan. Defaults to Standard values."
+ }
+ },
+ "appServicePlanLocation": {
+ "type": "string",
+ "defaultValue": "",
+ "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."
+ }
+ },
+ "newWebAppName": {
+ "type": "string",
+ "defaultValue": "",
+ "metadata": {
+ "description": "The globally unique name of the Web App. Defaults to the value passed in for \"botId\"."
+ }
+ }
+ },
+ "variables": {
+ "defaultAppServicePlanName": "[if(empty(parameters('existingAppServicePlan')), 'createNewAppServicePlan', parameters('existingAppServicePlan'))]",
+ "useExistingAppServicePlan": "[not(equals(variables('defaultAppServicePlanName'), 'createNewAppServicePlan'))]",
+ "servicePlanName": "[if(variables('useExistingAppServicePlan'), parameters('existingAppServicePlan'), parameters('newAppServicePlanName'))]",
+ "publishingUsername": "[concat('$', parameters('newWebAppName'))]",
+ "resourcesLocation": "[parameters('appServicePlanLocation')]",
+ "webAppName": "[if(empty(parameters('newWebAppName')), parameters('botId'), parameters('newWebAppName'))]",
+ "siteHost": "[concat(variables('webAppName'), '.azurewebsites.net')]",
+ "botEndpoint": "[concat('https://', variables('siteHost'), '/api/messages')]"
+ },
+ "resources": [
+ {
+ "comments": "Create a new Linux 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')]",
+ "kind": "linux",
+ "properties": {
+ "perSiteScaling": false,
+ "maximumElasticWorkerCount": 1,
+ "isSpot": false,
+ "reserved": true,
+ "isXenon": false,
+ "hyperV": false,
+ "targetWorkerCount": 0,
+ "targetWorkerSizeId": 0
+ }
+ },
+ {
+ "comments": "Create a Web App using a Linux App Service Plan",
+ "type": "Microsoft.Web/sites",
+ "apiVersion": "2018-11-01",
+ "location": "[variables('resourcesLocation')]",
+ "kind": "app,linux",
+ "dependsOn": [
+ "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]"
+ ],
+ "name": "[variables('webAppName')]",
+ "properties": {
+ "name": "[variables('webAppName')]",
+ "hostNameSslStates": [
+ {
+ "name": "[concat(parameters('newWebAppName'), '.azurewebsites.net')]",
+ "sslState": "Disabled",
+ "hostType": "Standard"
+ },
+ {
+ "name": "[concat(parameters('newWebAppName'), '.scm.azurewebsites.net')]",
+ "sslState": "Disabled",
+ "hostType": "Repository"
+ }
+ ],
+ "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('servicePlanName'))]",
+ "reserved": true,
+ "isXenon": false,
+ "hyperV": false,
+ "scmSiteAlsoStopped": false,
+ "clientAffinityEnabled": true,
+ "clientCertEnabled": false,
+ "hostNamesDisabled": false,
+ "containerSize": 0,
+ "dailyMemoryTimeQuota": 0,
+ "httpsOnly": false,
+ "redundancyMode": "None",
+ "siteConfig": {
+ "appSettings": [
+ {
+ "name": "JAVA_OPTS",
+ "value": "-Dserver.port=80"
+ },
+ {
+ "name": "MicrosoftAppId",
+ "value": "[parameters('appId')]"
+ },
+ {
+ "name": "MicrosoftAppPassword",
+ "value": "[parameters('appSecret')]"
+ }
+ ],
+ "cors": {
+ "allowedOrigins": [
+ "https://botservice.hosting.portal.azure.net",
+ "https://hosting.onecloud.azure-test.net/"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "type": "Microsoft.Web/sites/config",
+ "apiVersion": "2018-11-01",
+ "name": "[concat(variables('webAppName'), '/web')]",
+ "location": "[variables('resourcesLocation')]",
+ "dependsOn": [
+ "[resourceId('Microsoft.Web/sites/', variables('webAppName'))]"
+ ],
+ "properties": {
+ "numberOfWorkers": 1,
+ "defaultDocuments": [
+ "Default.htm",
+ "Default.html",
+ "Default.asp",
+ "index.htm",
+ "index.html",
+ "iisstart.htm",
+ "default.aspx",
+ "index.php",
+ "hostingstart.html"
+ ],
+ "netFrameworkVersion": "v4.0",
+ "linuxFxVersion": "JAVA|8-jre8",
+ "requestTracingEnabled": false,
+ "remoteDebuggingEnabled": false,
+ "httpLoggingEnabled": false,
+ "logsDirectorySizeLimit": 35,
+ "detailedErrorLoggingEnabled": false,
+ "publishingUsername": "[variables('publishingUsername')]",
+ "scmType": "None",
+ "use32BitWorkerProcess": true,
+ "webSocketsEnabled": false,
+ "alwaysOn": true,
+ "managedPipelineMode": "Integrated",
+ "virtualApplications": [
+ {
+ "virtualPath": "/",
+ "physicalPath": "site\\wwwroot",
+ "preloadEnabled": true
+ }
+ ],
+ "loadBalancing": "LeastRequests",
+ "experiments": {
+ "rampUpRules": []
+ },
+ "autoHealEnabled": false,
+ "localMySqlEnabled": false,
+ "ipSecurityRestrictions": [
+ {
+ "ipAddress": "Any",
+ "action": "Allow",
+ "priority": 1,
+ "name": "Allow all",
+ "description": "Allow all access"
+ }
+ ],
+ "scmIpSecurityRestrictions": [
+ {
+ "ipAddress": "Any",
+ "action": "Allow",
+ "priority": 1,
+ "name": "Allow all",
+ "description": "Allow all access"
+ }
+ ],
+ "scmIpSecurityRestrictionsUseMain": false,
+ "http20Enabled": false,
+ "minTlsVersion": "1.2",
+ "ftpsState": "AllAllowed",
+ "reservedInstanceCount": 0
+ }
+ },
+ {
+ "apiVersion": "2017-12-01",
+ "type": "Microsoft.BotService/botServices",
+ "name": "[parameters('botId')]",
+ "location": "global",
+ "kind": "bot",
+ "sku": {
+ "name": "[parameters('botSku')]"
+ },
+ "properties": {
+ "name": "[parameters('botId')]",
+ "displayName": "[parameters('botId')]",
+ "endpoint": "[variables('botEndpoint')]",
+ "msaAppId": "[parameters('appId')]",
+ "developerAppInsightsApplicationId": null,
+ "developerAppInsightKey": null,
+ "publishingCredentials": null,
+ "storageResourceId": null
+ },
+ "dependsOn": [
+ "[resourceId('Microsoft.Web/sites/', variables('webAppName'))]"
+ ]
+ }
+ ]
+}
diff --git a/samples/11.qnamaker/pom.xml b/samples/11.qnamaker/pom.xml
new file mode 100644
index 00000000..fcad9860
--- /dev/null
+++ b/samples/11.qnamaker/pom.xml
@@ -0,0 +1,244 @@
+
+
+
+ * The @Component annotation could be used on the Bot class instead of this method + * with the @Bean annotation. + *
+ * + * @return The Bot implementation for this application. + */ + @Bean + public Bot getBot(Configuration configuration) { + return new QnABot(configuration); + } + + /** + * Returns a custom Adapter that provides error handling. + * + * @param configuration The Configuration object to use. + * @return An error handling BotFrameworkHttpAdapter. + */ + @Override + public BotFrameworkHttpAdapter getBotFrameworkHttpAdaptor(Configuration configuration) { + return new AdapterWithErrorHandler(configuration); + } + +} + diff --git a/samples/11.qnamaker/src/main/java/com/microsoft/bot/sample/qnamaker/QnABot.java b/samples/11.qnamaker/src/main/java/com/microsoft/bot/sample/qnamaker/QnABot.java new file mode 100644 index 00000000..bbcdddb7 --- /dev/null +++ b/samples/11.qnamaker/src/main/java/com/microsoft/bot/sample/qnamaker/QnABot.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.bot.sample.qnamaker; + +import com.microsoft.bot.ai.qna.QnAMaker; +import com.microsoft.bot.ai.qna.QnAMakerEndpoint; +import com.microsoft.bot.ai.qna.QnAMakerOptions; +import com.microsoft.bot.builder.ActivityHandler; +import com.microsoft.bot.builder.MessageFactory; +import com.microsoft.bot.builder.TurnContext; +import com.microsoft.bot.integration.Configuration; +import org.slf4j.LoggerFactory; +import java.util.concurrent.CompletableFuture; + +public class QnABot extends ActivityHandler { + private Configuration configuration; + + public QnABot(Configuration withConfiguration) { + configuration = withConfiguration; + } + + @Override + protected CompletableFuture