Visit Azure
- Bot Service to register your bot and add it to
- various channels. The bot's endpoint URL typically looks
- like this:
-
https://your_bots_hostname/api/messages
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/functional/Bots/DotNet/FunctionalTestsBots.sln b/tests/functional/Bots/DotNet/FunctionalTestsBots.sln
deleted file mode 100644
index ea5591067b..0000000000
--- a/tests/functional/Bots/DotNet/FunctionalTestsBots.sln
+++ /dev/null
@@ -1,106 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30621.155
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Consumers", "Consumers", "{12088D79-235C-4387-9DA8-69AB93D52A8E}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Skills", "Skills", "{39117C87-FD02-40CD-A9A9-9A4C0A630521}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeFirst", "CodeFirst", "{C7A60083-78C8-4CEF-A358-4E53CBF0D12A}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleHostBot", "Consumers\CodeFirst\SimpleHostBot\SimpleHostBot.csproj", "{AAE978F8-D22B-41E8-B445-872FF4194713}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleHostBot-2.1", "Consumers\CodeFirst\SimpleHostBot-2.1\SimpleHostBot-2.1.csproj", "{0443C38C-A0DF-4A1A-8931-4A4BFFEEB386}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeFirst", "CodeFirst", "{6EF38D8C-7953-4D54-BA31-FFF055B7B217}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EchoSkillBot-2.1", "Skills\CodeFirst\EchoSkillBot-2.1\EchoSkillBot-2.1.csproj", "{56864219-785B-4600-9849-43CAF90F37E9}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EchoSkillBot", "Skills\CodeFirst\EchoSkillBot\EchoSkillBot.csproj", "{692F26DD-F7BA-49F3-AC6D-73047C1E5D61}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Composer", "Composer", "{33FA275E-9E5D-4582-BFF7-24B2C5DB2962}"
- ProjectSection(SolutionItems) = preProject
- Consumers\Composer\Directory.Build.props = Consumers\Composer\Directory.Build.props
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Composer", "Composer", "{33E2281F-C6A7-40EC-961A-FF9FF254FDDC}"
- ProjectSection(SolutionItems) = preProject
- Skills\Composer\Directory.Build.props = Skills\Composer\Directory.Build.props
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WaterfallHostBot", "Consumers\CodeFirst\WaterfallHostBot\WaterfallHostBot.csproj", "{15A946BE-39F9-4945-9895-0019ED3392FC}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WaterfallSkillBot", "Skills\CodeFirst\WaterfallSkillBot\WaterfallSkillBot.csproj", "{E3BECBEF-E41F-48D1-9EEB-A4D7E1CD34E3}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EchoSkillBot-v3", "Skills\CodeFirst\EchoSkillBot-v3\EchoSkillBot-v3.csproj", "{41BC9547-FD9E-40E1-B1D9-C3F25BC9A2F3}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SimpleHostBotComposer", "Consumers\Composer\SimpleHostBotComposer\SimpleHostBotComposer.csproj", "{FDC53B3A-0E15-4FDF-A587-05C8F90BC2B6}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EchoSkillBotComposer", "Skills\Composer\EchoSkillBotComposer\EchoSkillBotComposer.csproj", "{9BA47CF9-7D90-4B5C-A9FA-01797A435D53}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {AAE978F8-D22B-41E8-B445-872FF4194713}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AAE978F8-D22B-41E8-B445-872FF4194713}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AAE978F8-D22B-41E8-B445-872FF4194713}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AAE978F8-D22B-41E8-B445-872FF4194713}.Release|Any CPU.Build.0 = Release|Any CPU
- {0443C38C-A0DF-4A1A-8931-4A4BFFEEB386}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0443C38C-A0DF-4A1A-8931-4A4BFFEEB386}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0443C38C-A0DF-4A1A-8931-4A4BFFEEB386}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0443C38C-A0DF-4A1A-8931-4A4BFFEEB386}.Release|Any CPU.Build.0 = Release|Any CPU
- {56864219-785B-4600-9849-43CAF90F37E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {56864219-785B-4600-9849-43CAF90F37E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {56864219-785B-4600-9849-43CAF90F37E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {56864219-785B-4600-9849-43CAF90F37E9}.Release|Any CPU.Build.0 = Release|Any CPU
- {692F26DD-F7BA-49F3-AC6D-73047C1E5D61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {692F26DD-F7BA-49F3-AC6D-73047C1E5D61}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {692F26DD-F7BA-49F3-AC6D-73047C1E5D61}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {692F26DD-F7BA-49F3-AC6D-73047C1E5D61}.Release|Any CPU.Build.0 = Release|Any CPU
- {15A946BE-39F9-4945-9895-0019ED3392FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {15A946BE-39F9-4945-9895-0019ED3392FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {15A946BE-39F9-4945-9895-0019ED3392FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {15A946BE-39F9-4945-9895-0019ED3392FC}.Release|Any CPU.Build.0 = Release|Any CPU
- {E3BECBEF-E41F-48D1-9EEB-A4D7E1CD34E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E3BECBEF-E41F-48D1-9EEB-A4D7E1CD34E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E3BECBEF-E41F-48D1-9EEB-A4D7E1CD34E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E3BECBEF-E41F-48D1-9EEB-A4D7E1CD34E3}.Release|Any CPU.Build.0 = Release|Any CPU
- {41BC9547-FD9E-40E1-B1D9-C3F25BC9A2F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {41BC9547-FD9E-40E1-B1D9-C3F25BC9A2F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {41BC9547-FD9E-40E1-B1D9-C3F25BC9A2F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {41BC9547-FD9E-40E1-B1D9-C3F25BC9A2F3}.Release|Any CPU.Build.0 = Release|Any CPU
- {FDC53B3A-0E15-4FDF-A587-05C8F90BC2B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FDC53B3A-0E15-4FDF-A587-05C8F90BC2B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FDC53B3A-0E15-4FDF-A587-05C8F90BC2B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FDC53B3A-0E15-4FDF-A587-05C8F90BC2B6}.Release|Any CPU.Build.0 = Release|Any CPU
- {9BA47CF9-7D90-4B5C-A9FA-01797A435D53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9BA47CF9-7D90-4B5C-A9FA-01797A435D53}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9BA47CF9-7D90-4B5C-A9FA-01797A435D53}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9BA47CF9-7D90-4B5C-A9FA-01797A435D53}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {C7A60083-78C8-4CEF-A358-4E53CBF0D12A} = {12088D79-235C-4387-9DA8-69AB93D52A8E}
- {AAE978F8-D22B-41E8-B445-872FF4194713} = {C7A60083-78C8-4CEF-A358-4E53CBF0D12A}
- {0443C38C-A0DF-4A1A-8931-4A4BFFEEB386} = {C7A60083-78C8-4CEF-A358-4E53CBF0D12A}
- {6EF38D8C-7953-4D54-BA31-FFF055B7B217} = {39117C87-FD02-40CD-A9A9-9A4C0A630521}
- {56864219-785B-4600-9849-43CAF90F37E9} = {6EF38D8C-7953-4D54-BA31-FFF055B7B217}
- {692F26DD-F7BA-49F3-AC6D-73047C1E5D61} = {6EF38D8C-7953-4D54-BA31-FFF055B7B217}
- {33FA275E-9E5D-4582-BFF7-24B2C5DB2962} = {12088D79-235C-4387-9DA8-69AB93D52A8E}
- {33E2281F-C6A7-40EC-961A-FF9FF254FDDC} = {39117C87-FD02-40CD-A9A9-9A4C0A630521}
- {15A946BE-39F9-4945-9895-0019ED3392FC} = {C7A60083-78C8-4CEF-A358-4E53CBF0D12A}
- {E3BECBEF-E41F-48D1-9EEB-A4D7E1CD34E3} = {6EF38D8C-7953-4D54-BA31-FFF055B7B217}
- {41BC9547-FD9E-40E1-B1D9-C3F25BC9A2F3} = {6EF38D8C-7953-4D54-BA31-FFF055B7B217}
- {FDC53B3A-0E15-4FDF-A587-05C8F90BC2B6} = {33FA275E-9E5D-4582-BFF7-24B2C5DB2962}
- {9BA47CF9-7D90-4B5C-A9FA-01797A435D53} = {33E2281F-C6A7-40EC-961A-FF9FF254FDDC}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {2B77A921-EEA6-4006-ABD2-159C92F9F874}
- EndGlobalSection
-EndGlobal
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Authentication/AllowedCallersClaimsValidator.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Authentication/AllowedCallersClaimsValidator.cs
deleted file mode 100644
index 5b0b053639..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Authentication/AllowedCallersClaimsValidator.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System;
-using System.Collections.Generic;
-using System.Security.Claims;
-using System.Threading.Tasks;
-using Microsoft.Bot.Connector.Authentication;
-using Microsoft.Extensions.Configuration;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBot21.Authentication
-{
- ///
- /// Sample claims validator that loads an allowed list from configuration if present
- /// and checks that requests are coming from allowed parent bots.
- ///
- public class AllowedCallersClaimsValidator : ClaimsValidator
- {
- private const string ConfigKey = "AllowedCallers";
- private readonly List _allowedCallers;
-
- ///
- /// Initializes a new instance of the class.
- /// Loads the appIds for the configured callers. Only allows access to callers it has configured.
- ///
- /// The list of configured callers.
- public AllowedCallersClaimsValidator(IConfiguration config)
- {
- if (config == null)
- {
- throw new ArgumentNullException(nameof(config));
- }
-
- // AllowedCallers is the setting in the appsettings.json file
- // that consists of the list of parent bot IDs that are allowed to access the skill.
- // To add a new parent bot, simply edit the AllowedCallers and add
- // the parent bot's Microsoft app ID to the list.
- // In this sample, we allow all callers if AllowedCallers contains an "*".
- var section = config.GetSection(ConfigKey);
- var appsList = section.Get();
- if (appsList == null)
- {
- throw new ArgumentNullException($"\"{ConfigKey}\" not found in configuration.");
- }
-
- _allowedCallers = new List(appsList);
- }
-
- ///
- /// Checks that the appId claim in the skill request is in the list of callers configured for this bot.
- ///
- /// The list of claims to validate.
- /// A task that represents the work queued to execute.
- public override Task ValidateClaimsAsync(IList claims)
- {
- // If _allowedCallers contains an "*", we allow all callers.
- if (SkillValidation.IsSkillClaim(claims) && !_allowedCallers.Contains("*"))
- {
- // Check that the appId claim in the skill request is in the list of callers configured for this bot.
- var appId = JwtTokenValidation.GetAppIdFromClaims(claims);
- if (!_allowedCallers.Contains(appId))
- {
- throw new UnauthorizedAccessException($"Received a request from a bot with an app ID of \"{appId}\". To enable requests from this caller, add the app ID to your configuration file.");
- }
- }
-
- return Task.CompletedTask;
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Bots/EchoBot.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Bots/EchoBot.cs
deleted file mode 100644
index 14cccdbc7a..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Bots/EchoBot.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System.Threading;
-using System.Threading.Tasks;
-using Microsoft.Bot.Builder;
-using Microsoft.Bot.Schema;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBot21.Bots
-{
- public class EchoBot : ActivityHandler
- {
- ///
- /// Processes a message activity.
- ///
- /// Context for the current turn of conversation.
- /// CancellationToken propagates notifications that operations should be cancelled.
- /// A representing the result of the asynchronous operation.
- protected override async Task OnMessageActivityAsync(ITurnContext turnContext, CancellationToken cancellationToken)
- {
- if (turnContext.Activity.Text.Contains("end") || turnContext.Activity.Text.Contains("stop"))
- {
- // Send End of conversation at the end.
- await turnContext.SendActivityAsync(MessageFactory.Text($"Ending conversation from the skill..."), cancellationToken);
- var endOfConversation = Activity.CreateEndOfConversationActivity();
- endOfConversation.Code = EndOfConversationCodes.CompletedSuccessfully;
- await turnContext.SendActivityAsync(endOfConversation, cancellationToken);
- }
- else
- {
- await turnContext.SendActivityAsync(MessageFactory.Text($"Echo: {turnContext.Activity.Text}"), cancellationToken);
- await turnContext.SendActivityAsync(MessageFactory.Text("Say \"end\" or \"stop\" and I'll end the conversation and back to the parent."), cancellationToken);
- }
- }
-
- ///
- /// Processes an end of conversation activity.
- ///
- /// Context for the current turn of conversation.
- /// CancellationToken propagates notifications that operations should be cancelled.
- /// A representing the result of the asynchronous operation.
- protected override Task OnEndOfConversationActivityAsync(ITurnContext turnContext, CancellationToken cancellationToken)
- {
- // This will be called if the host bot is ending the conversation. Sending additional messages should be
- // avoided as the conversation may have been deleted.
- // Perform cleanup of resources if needed.
- return Task.CompletedTask;
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Controllers/BotController.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Controllers/BotController.cs
deleted file mode 100644
index c2fe9a198a..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Controllers/BotController.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Bot.Builder;
-using Microsoft.Bot.Builder.Integration.AspNet.Core;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBot21.Controllers
-{
- ///
- /// This ASP Controller is created to handle a request. Dependency Injection will provide the Adapter and IBot implementation at runtime.
- /// Multiple different IBot implementations running at different endpoints can be achieved by specifying a more specific type for the bot constructor argument.
- ///
- [Route("api/messages")]
- [ApiController]
- public class BotController : ControllerBase
- {
- private readonly IBotFrameworkHttpAdapter _adapter;
- private readonly IBot _bot;
-
- ///
- /// Initializes a new instance of the class.
- ///
- /// Adapter for the BotController.
- /// Bot for the BotController.
- public BotController(IBotFrameworkHttpAdapter adapter, IBot bot)
- {
- _adapter = adapter;
- _bot = bot;
- }
-
- ///
- /// Processes an HttpPost request.
- ///
- /// A representing the result of the asynchronous operation.
- [HttpPost]
- public async Task PostAsync()
- {
- await _adapter.ProcessAsync(Request, Response, _bot);
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/EchoSkillBot-2.1.csproj b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/EchoSkillBot-2.1.csproj
deleted file mode 100644
index 2df857a613..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/EchoSkillBot-2.1.csproj
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- netcoreapp2.1
- latest
- Microsoft.BotFrameworkFunctionalTests.EchoSkillBot21
- Microsoft.BotFrameworkFunctionalTests.EchoSkillBot21
-
-
-
- DEBUG;TRACE
-
-
-
-
-
-
-
-
-
- Always
-
-
-
-
\ No newline at end of file
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Program.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Program.cs
deleted file mode 100644
index bdfda7669a..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Program.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using Microsoft.AspNetCore;
-using Microsoft.AspNetCore.Hosting;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBot21
-{
- public class Program
- {
- ///
- /// The entry point of the application.
- ///
- /// The command line args.
- public static void Main(string[] args)
- {
- CreateWebHostBuilder(args).Build().Run();
- }
-
- ///
- /// Creates a new instance of the class with pre-configured defaults.
- ///
- /// The command line args.
- /// The initialized .
- public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
- WebHost.CreateDefaultBuilder(args)
- .UseStartup();
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Properties/launchSettings.json b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Properties/launchSettings.json
deleted file mode 100644
index 791f7e6a3b..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Properties/launchSettings.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "$schema": "http://json.schemastore.org/launchsettings.json",
- "iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
- "iisExpress": {
- "applicationUrl": "http://localhost:35405/",
- "sslPort": 0
- }
- },
- "profiles": {
- "IIS Express": {
- "commandName": "IISExpress",
- "launchBrowser": false,
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- },
- "EchoSkillBotDotNet21": {
- "commandName": "Project",
- "launchBrowser": true,
- "applicationUrl": "http://localhost:35405/",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/SkillAdapterWithErrorHandler.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/SkillAdapterWithErrorHandler.cs
deleted file mode 100644
index 76ef40f872..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/SkillAdapterWithErrorHandler.cs
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System;
-using Microsoft.Bot.Builder;
-using Microsoft.Bot.Builder.Integration.AspNet.Core;
-using Microsoft.Bot.Builder.TraceExtensions;
-using Microsoft.Bot.Connector.Authentication;
-using Microsoft.Bot.Schema;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.Logging;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBot21
-{
- public class SkillAdapterWithErrorHandler : BotFrameworkHttpAdapter
- {
- ///
- /// Initializes a new instance of the class to handle errors.
- ///
- /// The configuration properties.
- /// An implementation of the bots credentials.
- /// The configuration setting for the authentication.
- /// An instance of a logger.
- /// A state management object for the conversation.
- public SkillAdapterWithErrorHandler(IConfiguration configuration, ICredentialProvider credentialProvider, AuthenticationConfiguration authConfig, ILogger logger)
- : base(configuration, credentialProvider, authConfig, logger: logger)
- {
- OnTurnError = async (turnContext, exception) =>
- {
- try
- {
- // Log any leaked exception from the application.
- logger.LogError(exception, $"[OnTurnError] unhandled error : {exception.Message}");
-
- // Send a message to the user
- var errorMessageText = "The skill encountered an error or bug.";
- var errorMessage = MessageFactory.Text(errorMessageText + Environment.NewLine + exception, errorMessageText, InputHints.IgnoringInput);
- errorMessage.Value = exception;
- await turnContext.SendActivityAsync(errorMessage);
-
- errorMessageText = "To continue to run this bot, please fix the bot source code.";
- errorMessage = MessageFactory.Text(errorMessageText, errorMessageText, InputHints.ExpectingInput);
- await turnContext.SendActivityAsync(errorMessage);
-
- // Send a trace activity, which will be displayed in the Bot Framework Emulator
- // Note: we return the entire exception in the value property to help the developer, this should not be done in prod.
- await turnContext.TraceActivityAsync("OnTurnError Trace", exception.ToString(), "https://www.botframework.com/schemas/error", "TurnError");
-
- // Send and EndOfConversation activity to the skill caller with the error to end the conversation
- // and let the caller decide what to do.
- var endOfConversation = Activity.CreateEndOfConversationActivity();
- endOfConversation.Code = "SkillError";
- endOfConversation.Text = exception.Message;
- await turnContext.SendActivityAsync(endOfConversation);
- }
- catch (Exception ex)
- {
- logger.LogError(ex, $"Exception caught in SkillAdapterWithErrorHandler : {ex}");
- }
- };
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Startup.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Startup.cs
deleted file mode 100644
index 1c0bacc9bd..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/Startup.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.Bot.Builder;
-using Microsoft.Bot.Builder.BotFramework;
-using Microsoft.Bot.Builder.Integration.AspNet.Core;
-using Microsoft.Bot.Connector.Authentication;
-using Microsoft.BotFrameworkFunctionalTests.EchoSkillBot21.Bots;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBot21
-{
- public class Startup
- {
- public Startup(IConfiguration config)
- {
- Configuration = config;
- }
-
- public IConfiguration Configuration { get; }
-
- ///
- /// This method gets called by the runtime. Use this method to add services to the container.
- ///
- /// Method to add services to the container.
- public void ConfigureServices(IServiceCollection services)
- {
- services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
-
- // Configure credentials
- services.AddSingleton();
-
- // Register AuthConfiguration to enable custom claim validation.
- services.AddSingleton(sp => new AuthenticationConfiguration { ClaimsValidator = new Authentication.AllowedCallersClaimsValidator(sp.GetService()) });
-
- // Create the Bot Framework Adapter with error handling enabled.
- services.AddSingleton();
-
- // Create the bot as a transient. In this case the ASP Controller is expecting an IBot.
- services.AddTransient();
-
- if (!string.IsNullOrEmpty(Configuration["ChannelService"]))
- {
- // Register a ConfigurationChannelProvider -- this is only for Azure Gov.
- services.AddSingleton();
- }
- }
-
- ///
- /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
- ///
- /// The application request pipeline to be configured.
- /// The web hosting environment.
- public void Configure(IApplicationBuilder app, IHostingEnvironment env)
- {
- if (env.IsDevelopment())
- {
- app.UseDeveloperExceptionPage();
- }
- else
- {
- app.UseHsts();
- }
-
- app.UseDefaultFiles();
- app.UseStaticFiles();
-
- // app.UseHttpsRedirection();
- app.UseMvc();
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/appsettings.json b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/appsettings.json
deleted file mode 100644
index c61cdb4d79..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/appsettings.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "MicrosoftAppId": "",
- "MicrosoftAppPassword": "",
- "ChannelService": "",
- // This is a comma separate list with the App IDs that will have access to the skill.
- // This setting is used in AllowedCallersClaimsValidator.
- // Examples:
- // [ "*" ] allows all callers.
- // [ "AppId1", "AppId2" ] only allows access to parent bots with "AppId1" and "AppId2".
- "AllowedCallers": [ "*" ]
-}
\ No newline at end of file
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/wwwroot/default.htm b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/wwwroot/default.htm
deleted file mode 100644
index 56d1b43377..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/wwwroot/default.htm
+++ /dev/null
@@ -1,420 +0,0 @@
-
-
-
-
-
-
- EchoSkillBot-2.1DotNet
-
-
-
-
-
-
-
-
-
EchoSkillBot-2.1DotNet Bot
-
-
-
-
-
Your bot is ready!
-
You can test your bot in the Bot Framework Emulator
- by connecting to http://localhost:3978/api/messages.
Visit Azure
- Bot Service to register your bot and add it to
- various channels. The bot's endpoint URL typically looks
- like this:
-
https://your_bots_hostname/api/messages
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/wwwroot/manifests/echoskillbot-manifest-1.0.json b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/wwwroot/manifests/echoskillbot-manifest-1.0.json
deleted file mode 100644
index 68b6a165ff..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-2.1/wwwroot/manifests/echoskillbot-manifest-1.0.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "$schema": "https://schemas.botframework.com/schemas/skills/v2.1/skill-manifest.json",
- "$id": "EchoSkillBotDotNet21",
- "name": "EchoSkillBotDotNet21",
- "version": "1.0",
- "description": "This is a skill for echoing what the user sent to the bot (using .netcore 2.1).",
- "publisherName": "Microsoft",
- "privacyUrl": "https://microsoft.com/privacy",
- "copyright": "Copyright (c) Microsoft Corporation. All rights reserved.",
- "license": "https://github.com/microsoft/BotFramework-FunctionalTests/blob/main/LICENSE",
- "tags": [
- "echo"
- ],
- "endpoints": [
- {
- "name": "default",
- "protocol": "BotFrameworkV3",
- "description": "Localhost endpoint for the skill (on port 35405)",
- "endpointUrl": "http://localhost:35405/api/messages",
- "msAppId": "00000000-0000-0000-0000-000000000000"
- }
- ]
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/ApiControllerActionInvokerWithErrorHandler.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/ApiControllerActionInvokerWithErrorHandler.cs
deleted file mode 100644
index 4ad82c1409..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/ApiControllerActionInvokerWithErrorHandler.cs
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using Microsoft.Bot.Builder.Dialogs;
-using Microsoft.Bot.Connector;
-using Newtonsoft.Json;
-using System.IO;
-using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Web.Http.Controllers;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBotv3
-{
- ///
- /// Web Api Controller to intersect HTTP operations when the Action Invoker is triggered to capture exceptions and send it to the bot as an Activity.
- ///
- internal class ApiControllerActionInvokerWithErrorHandler : ApiControllerActionInvoker
- {
- public async override Task InvokeActionAsync(HttpActionContext actionContext, CancellationToken cancellationToken)
- {
- var result = base.InvokeActionAsync(actionContext, cancellationToken);
-
- if (result.Exception != null && result.Exception.GetBaseException() != null)
- {
- var stream = new StreamReader(actionContext.Request.Content.ReadAsStreamAsync().Result);
- stream.BaseStream.Position = 0;
- var rawRequest = stream.ReadToEnd();
- var activity = JsonConvert.DeserializeObject(rawRequest);
-
- activity.Type = "exception";
- activity.Text = result.Exception.ToString();
- activity.Value = result.Exception;
-
- await Conversation.SendAsync(activity, () => new Dialogs.RootDialog());
- }
-
- return await result;
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/App_Start/WebApiConfig.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/App_Start/WebApiConfig.cs
deleted file mode 100644
index 97fc72a901..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/App_Start/WebApiConfig.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using Newtonsoft.Json;
-using Newtonsoft.Json.Serialization;
-using System.Web.Http;
-using System.Web.Http.Controllers;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBotv3
-{
- public static class WebApiConfig
- {
- public static void Register(HttpConfiguration config)
- {
- // Json settings
- config.Formatters.JsonFormatter.SerializerSettings.NullValueHandling = NullValueHandling.Ignore;
- config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
- config.Formatters.JsonFormatter.SerializerSettings.Formatting = Formatting.Indented;
- JsonConvert.DefaultSettings = () => new JsonSerializerSettings()
- {
- ContractResolver = new CamelCasePropertyNamesContractResolver(),
- Formatting = Newtonsoft.Json.Formatting.Indented,
- NullValueHandling = NullValueHandling.Ignore,
- };
-
- // Web API configuration and services
-
- // Web API routes
- config.MapHttpAttributeRoutes();
-
- config.Routes.MapHttpRoute(
- name: "DefaultApi",
- routeTemplate: "api/{controller}/{id}",
- defaults: new { id = RouteParameter.Optional }
- );
- config.Services.Replace(typeof(IHttpActionInvoker), new ApiControllerActionInvokerWithErrorHandler());
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Authentication/CustomAllowedCallersClaimsValidator.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Authentication/CustomAllowedCallersClaimsValidator.cs
deleted file mode 100644
index 7d3de967b2..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Authentication/CustomAllowedCallersClaimsValidator.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using Microsoft.Bot.Connector.SkillAuthentication;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Security.Claims;
-using System.Threading.Tasks;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBotv3.Authentication
-{
- ///
- /// Sample claims validator that loads an allowed list from configuration if present
- /// and checks that requests are coming from allowed parent bots.
- ///
- public class CustomAllowedCallersClaimsValidator : ClaimsValidator
- {
- private readonly IList _allowedCallers;
-
- public CustomAllowedCallersClaimsValidator(IList allowedCallers)
- {
- // AllowedCallers is the setting in web.config file
- // that consists of the list of parent bot IDs that are allowed to access the skill.
- // To add a new parent bot simply go to the AllowedCallers and add
- // the parent bot's Microsoft app ID to the list.
-
- _allowedCallers = allowedCallers ?? throw new ArgumentNullException(nameof(allowedCallers));
- if (!_allowedCallers.Any())
- {
- throw new ArgumentNullException(nameof(allowedCallers), "AllowedCallers must contain at least one element of '*' or valid MicrosoftAppId(s).");
- }
- }
-
- ///
- /// This method is called from JwtTokenValidation.ValidateClaimsAsync
- ///
- ///
- public override Task ValidateClaimsAsync(IList claims)
- {
- if (claims == null)
- {
- throw new ArgumentNullException(nameof(claims));
- }
-
- if (!claims.Any())
- {
- throw new UnauthorizedAccessException("ValidateClaimsAsync.claims parameter must contain at least one element.");
- }
-
- if (SkillValidation.IsSkillClaim(claims))
- {
- // if _allowedCallers has one item of '*', allow all parent bot calls and do not validate the appid from claims
- if (_allowedCallers.Count == 1 && _allowedCallers[0] == "*")
- {
- return Task.CompletedTask;
- }
-
- // Check that the appId claim in the skill request is in the list of skills configured for this bot.
- var appId = JwtTokenValidation.GetAppIdFromClaims(claims).ToUpperInvariant();
- if (_allowedCallers.Contains(appId))
- {
- return Task.CompletedTask;
- }
-
- throw new UnauthorizedAccessException($"Received a request from a bot with an app ID of \"{appId}\". To enable requests from this caller, add the app ID to your configuration file.");
- }
-
- throw new UnauthorizedAccessException($"ValidateClaimsAsync called without a Skill claim in claims.");
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Authentication/CustomSkillAuthenticationConfiguration.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Authentication/CustomSkillAuthenticationConfiguration.cs
deleted file mode 100644
index 2d01093e67..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Authentication/CustomSkillAuthenticationConfiguration.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using Microsoft.Bot.Connector.SkillAuthentication;
-using System.Configuration;
-using System.Linq;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBotv3.Authentication
-{
- public class CustomSkillAuthenticationConfiguration : AuthenticationConfiguration
- {
- private const string AllowedCallersConfigKey = "EchoBotAllowedCallers";
- public CustomSkillAuthenticationConfiguration()
- {
- // Could pull this list from a DB or anywhere.
- var allowedCallers = ConfigurationManager.AppSettings[AllowedCallersConfigKey].Split(',').Select(s => s.Trim().ToUpperInvariant()).ToList();
- ClaimsValidator = new CustomAllowedCallersClaimsValidator(allowedCallers);
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Controllers/MessagesController.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Controllers/MessagesController.cs
deleted file mode 100644
index 55cc612cd5..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Controllers/MessagesController.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System.Diagnostics;
-using System.Net;
-using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
-using System.Web.Http;
-using Autofac;
-using Microsoft.Bot.Builder.Dialogs;
-using Microsoft.Bot.Builder.Dialogs.Internals;
-using Microsoft.Bot.Connector;
-using Microsoft.Bot.Connector.SkillAuthentication;
-using Microsoft.BotFrameworkFunctionalTests.EchoSkillBotv3.Authentication;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBotv3
-{
- // Specify which type provides the authentication configuration to allow for validation for skills.
- [SkillBotAuthentication(AuthenticationConfigurationProviderType = typeof(CustomSkillAuthenticationConfiguration))]
- public class MessagesController : ApiController
- {
- ///
- /// POST: api/Messages
- /// Receive a message from a user and reply to it
- ///
- public async Task Post([FromBody]Activity activity)
- {
- if (activity.GetActivityType() == ActivityTypes.Message)
- {
- await Conversation.SendAsync(activity, () => new Dialogs.RootDialog());
- }
- else
- {
- await HandleSystemMessage(activity);
- }
- var response = Request.CreateResponse(HttpStatusCode.OK);
- return response;
- }
-
- private async Task HandleSystemMessage(Activity message)
- {
- string messageType = message.GetActivityType();
-
- if (messageType == ActivityTypes.EndOfConversation)
- {
- Trace.TraceInformation($"EndOfConversation: {message}");
-
- // This Recipient null check is required for PVA manifest validation.
- // PVA will send an EOC activity with null Recipient.
- if (message.Recipient != null)
- {
- // Clear the dialog stack if the root bot has ended the conversation.
- using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, message))
- {
- var botData = scope.Resolve();
- await botData.LoadAsync(default(CancellationToken));
-
- var stack = scope.Resolve();
- stack.Reset();
-
- await botData.FlushAsync(default(CancellationToken));
- }
- }
- }
- else if (messageType == ActivityTypes.DeleteUserData)
- {
- // Implement user deletion here
- // If we handle user deletion, return a real message
- }
- else if (messageType == ActivityTypes.ConversationUpdate)
- {
- // Handle conversation state changes, like members being added and removed
- // Use Activity.MembersAdded and Activity.MembersRemoved and Activity.Action for info
- // Not available in all channels
- }
- else if (messageType == ActivityTypes.ContactRelationUpdate)
- {
- // Handle add/remove from contact lists
- // Activity.From + Activity.Action represent what happened
- }
- else if (messageType == ActivityTypes.Typing)
- {
- // Handle knowing that the user is typing
- }
- else if (messageType == ActivityTypes.Ping)
- {
- }
-
- return null;
- }
- }
-}
diff --git a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Dialogs/RootDialog.cs b/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Dialogs/RootDialog.cs
deleted file mode 100644
index 1ae1313a31..0000000000
--- a/tests/functional/Bots/DotNet/Skills/CodeFirst/EchoSkillBot-v3/Dialogs/RootDialog.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-using System;
-using System.Threading.Tasks;
-using Microsoft.Bot.Builder.Dialogs;
-using Microsoft.Bot.Connector;
-
-namespace Microsoft.BotFrameworkFunctionalTests.EchoSkillBotv3.Dialogs
-{
- [Serializable]
- public class RootDialog : IDialog