Blog Post

IIS Support Blog
5 MIN READ

Navigating Azure Bot Networking: Key Considerations for Privatization

manojdixit's avatar
manojdixit
Icon for Microsoft rankMicrosoft
Nov 01, 2024

Navigating the complexities of cloud solutions can be a daunting task, and Azure Bot Solutions are no exception. Many customers face the challenge of privatizing their bot’s messaging endpoint, only to encounter communication breakdowns with the channel—resulting in 502 errors and unresponsive bots.

While the necessity of a public messaging endpoint is outlined in the article Bot Framework Security and Privacy Frequently Asked Questions - Bot Service | Microsoft Learn, I aim to share insights and practical considerations from my experience working with clients. Please reach to Microsoft Support for more guidance.

Privatizing a bot solution involves more complexity than traditional web applications or APIs, where clients make direct calls to Web Applications. In a bot solution, users do not directly interact with Bot/Web App; instead, their requests are orchestrated and proxied through a channel connector. Additionally, bots can send messages asynchronously, facilitated by these channels.  An example of Network Isolation in Azure Web App, includes all components that can made available within customer managed network.

Bot as a Solution

  • Clients: User-facing application used to consume/converse with Bot solutions. Examples include Web Chat Widget, Teams, Slack etc.  
  • The Bot Service: This managed SaaS umbrella includes configuration management, channel services and token services. Services are made available with the <service>.botframework.com endpoints.
  • The Bot Application: Using the Bot SDK or Composer, you create an HTTP-based application that encapsulates your functional and conversational logic, including recognition, processing, and storage. The Bot application operates using the Bot Framework Activity Specification. The Bot application exposes a public messaging endpoint for receiving activities (messaging endpoint).
  • Channel Connectors: While Azure Bot Service offers two primary channels (Direct Line and Webchat), it also allows extensibility for other clients/channels. Channel connectors are implemented by their respective owners and operate within their managed data centers. The messaging endpoint is not exposed to end users; instead, users connect through channel connectors that manage user sessions, activity orchestration, and authentication. Different clients, such as Teams and Slack, represent messages and activities uniquely. Since Bot SDK applications understands and responds with activities as defined in the Bot Framework Activity Specification, channels are responsible for transforming activities and forwarding them to the application.

References:

 

Simplified view of Directline Bot (Web Chat: Full-featured bundle):

 

 

 

Simplified view of Teams Bot Solution:

 

The Direct Line and Teams clients do not directly call your bot’s endpoint; instead, their requests are proxied through the Direct Line Service or Teams Channel Connector. When you privatize your bot application/endpoint, there is a high potential of disrupting communication between the channel connector and the bot application. Since these channel connectors operate within managed data centers, the requests from channels to your bot will traverse the public internet. This is why a public messaging endpoint is essential for most channels.

Now you might be concerned about allowing public traffic to your VM. Here are few suggestions and explanations:

  • Bot Framework Security and Privacy Frequently Asked Questions - Bot Service | Microsoft Learn
    • Firstly, the Bot Application/Adapter is secured with Entra Authentication and only authentic callers who have capability to generate a valid Entra JWT token can consume the Bot:
      • What keeps my bot secure from clients impersonating the Bot Framework Service?
        • All authentic Bot Framework requests are accompanied by a JWT token whose cryptographic signature can be verified by following the authentication guide. The token is designed so attackers can't impersonate trusted services.
        • The security token accompanying every request to your bot has the ServiceUrl encoded within it, which means that even if an attacker gains access to the token, they can't redirect the conversation to a new ServiceUrl. This is enforced by all implementations of the SDK and documented in our authentication reference materials.
        • If the incoming token is missing or malformed, the Bot Framework SDK won't generate a token in response. This limits how much damage can be done if the bot is incorrectly configured.
        • Inside the bot, you can manually check the ServiceUrl provided in the token. This makes the bot more fragile if the service topology changes, so while this is possible, it's not recommended.

You can configure additional network/Transport layer security to allow intended channels to consume the Bot.

Options to secure Bot Solution:

Considerations with DirectLine App Service Extension (DL-ASE) | The Fully Insolated Directline Bot:

 

 

Hope this helps!

Updated May 28, 2025
Version 8.0

1 Comment

  • This is really helpful. Detailed enough to understand the flow. Thanks for adding in here.