Bots Framework Deployment

TL;DR: A technical guide for deploying conversational bots using Azure Bot Framework across multiple channels.

Technical deployment guide for Azure Bot Framework integration

Overview

This document provides step-by-step instructions for deploying bots using the Microsoft Azure Bot Framework and configuring them for various communication channels including Skype, Telegram, and web interfaces.

Bot Registration

Azure Portal Setup

  1. Navigate to the Azure Portal
  2. Create a new Bot Channels Registration resource
  3. Configure the following settings:
SettingValue
Bot HandleUnique identifier for your bot
SubscriptionYour Azure subscription
Resource GroupNew or existing resource group
LocationNearest Azure region
Pricing TierF0 (Free) or S1 (Standard)
Messaging Endpointhttps://your-server.com/api/messages

Application ID and Password

  1. Navigate to SettingsMicrosoft App ID
  2. Click Manage to go to the Application Registration Portal
  3. Generate a new password and save it securely
  4. Update your bot’s configuration with:
    • MicrosoftAppId: Your App ID
    • MicrosoftAppPassword: Generated password

Channel Configuration

Skype Channel Setup

  1. Go to Channels in your bot registration

  2. Click Skype to add the channel

  3. Configure messaging capabilities:

    • Enable/disable group messaging
    • Configure calling features if needed
    • Set up content moderation
  4. Publish the bot:

    • For testing: Use the provided Skype link
    • For production: Submit for certification

Telegram Channel Setup

  1. Create a bot through BotFather on Telegram:

    /newbot
    [Enter bot name]
    [Enter bot username]
    
  2. Copy the API token provided by BotFather

  3. In Azure Portal → Channels → Telegram:

    • Paste the access token
    • Enable the channel
  4. Test by messaging your bot on Telegram

Web Chat Setup

  1. Navigate to ChannelsWeb Chat

  2. Get embed code or use Direct Line:

    <iframe src='https://webchat.botframework.com/embed/YOUR_BOT_HANDLE?s=SECRET_KEY'></iframe>
    
  3. For Direct Line API:

    • Get secret keys from the channel configuration
    • Use REST API or DirectLine client library

Server Preparation

Prerequisites

  • Node.js 8.x or later (for Node.js bots)
  • .NET Core 2.1+ (for C# bots)
  • HTTPS endpoint accessible from Azure

Environment Configuration

Create environment variables:

export MICROSOFT_APP_ID="your-app-id"
export MICROSOFT_APP_PASSWORD="your-app-password"
export PORT=3978

Bot Framework SDK Setup

For Node.js:

npm install botbuilder
npm install restify

For .NET:

dotnet add package Microsoft.Bot.Builder
dotnet add package Microsoft.Bot.Connector

Deployment Options

Option 1: Azure App Service

  1. Create App Service in Azure Portal
  2. Configure deployment from Git/GitHub
  3. Set application settings for credentials
  4. Deploy code and verify endpoint

Option 2: Container Deployment

FROM node:12-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3978
CMD ["node", "index.js"]

Option 3: On-Premise with HTTPS Proxy

  1. Set up reverse proxy (nginx/Apache)
  2. Configure SSL certificates
  3. Ensure firewall allows inbound HTTPS
  4. Point Azure messaging endpoint to proxy

Testing and Validation

Bot Framework Emulator

  1. Download Bot Framework Emulator
  2. Configure endpoint: http://localhost:3978/api/messages
  3. Enter App ID and Password for secured testing
  4. Test conversation flows

Production Testing

  1. Use the Test in Web Chat feature in Azure Portal
  2. Verify all channels are receiving messages
  3. Check Application Insights for errors
  4. Monitor response times and availability

Troubleshooting

IssueSolution
401 UnauthorizedVerify App ID and Password match
Endpoint unreachableCheck HTTPS and firewall settings
Channel not respondingRe-validate channel tokens
Messages not deliveredCheck messaging endpoint configuration

This guide covers the fundamental deployment steps. For production deployments, implement proper logging, monitoring, and error handling.