Deploying Your Bot

Prerequisites

Instructions

Linux Web App

  1. From Azure Portal (portal.azure.com) spin up a Linux Web App
  2. Log in to Docker locally (docker login and enter your credentials for Docker Hub)
  3. Build the docker image from the bot’s Dockerfile (you can name the image anything you wish, here it’s flaskbot). For example:
docker build -f Dockerfile -t flaskbot:latest .
docker images
  1. Tag the image with the Docker Hub username (replace <dockeruser> with your docker user name and give the image name) and tag:
docker tag <image id> <dockeruser>/flaskbot
  1. Push up the docker image to Docker Hub (takes some time):
docker login
docker push <dockeruser>/flaskbot
  1. Specify the docker image to the Linux Web App (give the app a name, replacing <mybotname>, resource group, replacing <mybotrg>, and point to the image):
az login
az webapp config container set --name <mybotname> --resource-group <mybotrg> --docker-registry-server-url <dockeruser>/flaskbot
  1. Navigate to portal and click on Docker Container in left panel to ensure the app is pulling in the correct image from Docker Hub.
  2. Check that the endpoint is working:
  • Navigate to http://<your web app name>.azurewebsites.net/api/messages and should get a Method Not Allowed http error (because GET not allowed here - but this message indicates the flask app is running)

Bot Framework Portal

Register your bot with the Microsoft Bot Framework: register.

Connect it to channels as is shown in connect.

Happy chatting!