AddBotApplicationExtensions.UseBotApplication Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| UseBotApplication(IEndpointRouteBuilder, String) |
Configures the default BotApplication to handle bot messages at the specified route. |
| UseBotApplication<TApp>(IEndpointRouteBuilder, String) |
Configures the application to handle bot messages at the specified route and returns the registered bot application instance. |
UseBotApplication(IEndpointRouteBuilder, String)
Configures the default BotApplication to handle bot messages at the specified route.
public static Microsoft.Teams.Core.BotApplication UseBotApplication(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string routePath = "api/messages");
static member UseBotApplication : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string -> Microsoft.Teams.Core.BotApplication
<Extension()>
Public Function UseBotApplication (endpoints As IEndpointRouteBuilder, Optional routePath As String = "api/messages") As BotApplication
Parameters
- endpoints
- IEndpointRouteBuilder
The endpoint route builder used to configure endpoints.
- routePath
- String
The route path at which to listen for incoming bot messages. Defaults to "api/messages".
Returns
The registered BotApplication instance.
Applies to
UseBotApplication<TApp>(IEndpointRouteBuilder, String)
Configures the application to handle bot messages at the specified route and returns the registered bot application instance.
public static TApp UseBotApplication<TApp>(this Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints, string routePath = "api/messages") where TApp : Microsoft.Teams.Core.BotApplication;
static member UseBotApplication : Microsoft.AspNetCore.Routing.IEndpointRouteBuilder * string -> 'App (requires 'App :> Microsoft.Teams.Core.BotApplication)
<Extension()>
Public Function UseBotApplication(Of TApp As BotApplication) (endpoints As IEndpointRouteBuilder, Optional routePath As String = "api/messages") As TApp
Type Parameters
- TApp
The type of the bot application to use. Must inherit from BotApplication.
Parameters
- endpoints
- IEndpointRouteBuilder
The endpoint route builder used to configure endpoints.
- routePath
- String
The route path at which to listen for incoming bot messages. Defaults to "api/messages".
Returns
The registered bot application instance of type TApp.
Exceptions
Thrown if the bot application of type TApp is not registered in the application's service container.
Remarks
This method adds authentication and authorization middleware to the HTTP pipeline and maps a POST endpoint for bot messages. The endpoint requires authorization. Ensure that the bot application is registered in the service container before calling this method.