In this exercise you will learn how to register your bot and deploy it to Azure so others can use it.
To successfully complete this exercise you should be able to perform the following actions:
- Register your bot in the Bot Framework Portal
- Create an Azure Web App and publish your bot code there
- You must have either completed the prior exercise, or you can use the starting point provided for either C# or Node.js
- An Azure subscription
- In Node.js you must have Git command line interface
- An Skype account (optional)
Before others can use your bot, you must register it with the Bot Framework. Registration is a simple process. You are prompted to provide some information about your bot and then the portal generates the app ID and password that your bot will use to authenticate with the Bot Framework.
Before others can use your bot, you must deploy it to the cloud. You can deploy it to Azure or to any other cloud service.
You need to add App Settings keys to your Web App like follows:
Key | Description |
---|---|
AZURE_SEARCH_ACCOUNT | Use the Azure Search account name |
AZURE_SEARCH_INDEX | Use the Azure Search index name |
AZURE_SEARCH_KEY | Use the Azure Search key |
MICROSOFT_APP_ID | Use the Bot App ID |
MICROSOFT_APP_PASSWORD | Use the Bot Password |
LUIS_MODEL_URL | Use the LUIS model URL |
TICKET_SUBMISSION_URL | Use your Web App URL (eg. https://help-desk-bot.azurewebsites.net/) |
You need to configure the Web App to support deployments from a local git repository and setup your deployment credentials. Next, you need to add that local git repository to your project. When you push your changes to the repository the code is automatically published to the Web app.
You should publish your bot directly from Visual Studio to a Web App. If you don't have any created, you can create one. Otherwise, you can pick an existing one.
You need to add App Settings keys to your Web App like follows:
Key | Description |
---|---|
AzureSearchAccount | Use the Azure Search account name |
AzureSearchIndex | Use the Azure Search index name |
AzureSearchKey | Use the Azure Search key |
MicrosoftAppId | Use the Bot App ID |
MicrosoftAppPassword | Use the Bot Password |
TicketsAPIBaseUrl | Use your Web App URL (eg. https://help-desk-bot.azurewebsites.net/) |
You need to update the App Service URL for your bot in the Bot Framework Portal with the URL of the Web App. Remember to put the /api/messages
at the end of the URL and ensure the protocol is https.
NOTE: At this point you can test your published bot in the Web Channel Control in the Bot Framework Portal and Skype also (you will need to install Skype).
- Test the bot from the Bot Emulator - you need to use ngrok to let the bot know how to reply to your local computer.
- Run code locally while testing the bot via Skype or WebChat.
- You can try adding Bot Analytics by using Application Insights.
- Register the bot with another channel, such as Slack.