Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.
This repository was archived by the owner on Oct 3, 2025. It is now read-only.

.NET Client to Connect to Direct Line App Service extension results in 403 exception #38

@ram-xv

Description

@ram-xv

Version

What package version of the SDK are you using.
Microsoft.Bot.Builder.Integration.AspNet.Core:4.21.0

Describe the bug

After creating a .NET Client to Connect to Direct Line App Service extension, a 403 error is thrown.
Documentation for creating DLASE Client in .NET: https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-directline-extension-net-client?view=azure-bot-service-4.0

To Reproduce

Steps to reproduce the behavior:

  1. Configure a .NET bot for Direct Line App Service extension from this documentation
    a. Important: Please make sure to include MicrosoftAppTenantId in app service configuration after deployment
  2. Create .NET Client to Connect to Direct Line App Service extension, by following this documentation 
  3. Cloned the BotFramework-DirectLine-DotNet project locally. Do not use NuGet or any external third-party package manager for this BotFramework-DirectLine-DotNet library. Once cloned, add a project reference from your C# client app to the BotFramework-DirectLine-DotNet project.
  4. Run the .NET DLASE Client and observe the error

Expected behavior

Run .NET Client to Connect to Direct Line App Service extension without errors.

Error details

System.AggregateException: "One or more errors occurred. (The server returned status code '403' when status code '101' was expected.)" ---> System.Net.WebSockets.WebSocketException: "The server returned status code '403' when status
code '101' was expected." at System.Net.WebSockets.WebSocketHandle.d__13.MoveNext()\n at System.Net.WebSockets.ClientWebSocket.d__15.MoveNext()\n at Microsoft.Bot.Streaming.Transport.WebSockets.WebSocketClient.d__21.MoveNext()\n at Microsoft.Bot.Streaming.Transport.WebSockets.WebSocketClient.d__20.MoveNext()\n at Microsoft.Bot.Connector.DirectLine.StreamingConversations.d__15.MoveNext() in /Users/ram/Documents/bot/BF/directline_bots/Csharp/CSharpDLASEClient/BotFramework-DirectLine-DotNet/libraries/Streaming/StreamingConversations.cs:line 77\n at CustomerDLASE_ConsoleApp.DirectLineInterface.d__7.MoveNext() in /Users/ram/Documents/bot/BF/directline_bots/Csharp/CSharpDLASEClient/CustomerDLASE_ConsoleApp/Directline.cs:69 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\n at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\n at System.Threading.Tasks.Task.Wait()\n at Program.

$(String[] args) in /Users/ram/Documents/bot/BF/directline_bots/Csharp/CSharpDLASEClient/CustomerDLASE_ConsoleApp/Program.cs:24

[bug]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions