Этот документ доступен на русском языке.
This article describes the basic chatbot publishing procedure on Chatbotlab platform, as well as the process of connecting a chatbot to various channels via Azure portal (Bot Framework), using an example of Telegram and Facebook Messenger.
- Microsoft account.
- A registered bank card with a balance of at least $1 USD. (This amount will be blocked on your account by Azure service for some time only for verification of the card).
Channels for the publication of a chatbot on Azure portal are provided free, using the F0 plan. More detailed information about plans you can find here .
If you have any difficulties with registration, please write to our technical support.
To use Azure portal services, you need to add a subscription to your account. To do this, log into the Microsoft Azure page using your login and password, and then go to Subscriptions section in the upper left corner of page, and click on add subscription.
On the next page you will be asked to choose one of the subscriptions. We recommend you to choose, first of all, the Pay-As-You-Go option of subscription, because it is free and involves payment only for additional services. To activate a subscription, you will need to fill out all the forms with data that system will require. After activating a subscription, you can start working with Azure portal by clicking on Portal in upper right corner of the Microsoft Azure page.
In order to register a chatbot on Azure portal, you need to use the Bot Channels Registration service.
Click on the New button, which is on the left at Azure portal panel. In left part of the window that appears, select AI + Cognitive Services line, and then click on See all opposite the name of list - Featured - in the right part of window to expand the full list of services. Find Bot Service section and click on Bot Channels Registration.
After that, appears a window with information about service. At the bottom of window, click the Create button.
If you have not yet added a subscription to your account, you will be prompted to do so. More about this you can read here
In opened Bot Service window, you need to provide required information about a chatbot:
- Enter chatbot’s Bot name: "ACService". Name must be between 4 and 36 characters.
- Next, select your subscription in Subscription field. In our case, this is Pay-As-You-Go.
- The Resource groups field is filled in automatically with chatbot name: "ACService". You can change a group name or select an existing one.
Resource groups - container with related resources for the Azure solution.
- Select a geographic region closest to chatbot creation in Location field.
- Next, you must select Pricing tier. We choose recommended and free price category - F0.
- Then fill in the Messaging endpoint field. The URL address of Messaging endpoint can be found in a chatbot profile on our website.
Application Insights - free service for monitoring and analyzing chatbot work.
- After providing all necessary information about chatbot, click the Create button at the bottom of Bot Service window.
After a while, in the upper right corner of portal you will see a notification about successful deployment of the chatbot - Deployment succeeded.
More detailed information on registering a chatbot on the Azure portal you can find here.
During a publication of chatbot on the ChatbotLab platform, you will need the Microsoft App ID and Microsoft App password credentials, which will need to be copied and pasted into the Application ID and Application password fields, respectively, in BotFramework.com channel settings.
In order to obtain these credentials:
- Click on Resource groups in the left panel of the Azure portal, select needed "ACService" resource in the resource list, and then click on the similar name of our chatbot.
- In the left panel of Bot Channels Registration service window, in Bot management section select the Settings menu. In Bot profile, we find Microsoft App ID line in Configuration section. Copy and save the Application ID shown below it.
- Then click on Manage link near Microsoft App ID and on the opened page, in Application Secrets section, click the Generate New Password button. Copy and save the Application password in a safe place.
If you have an error when generating a new password, you can find out the existing password as follows:
- Go into Resource groups, select the required resource and click on Deployments line in the left panel of resource window in Settings section.
- Then in the list, find a name of desired chatbot and click on it.
- In the next window you can find APPSECRET line in Inputs section, which is the Application password.
Now you can use these credentials to publish a chatbot on the ChatbotLab platform.
Go to My chatbots from Chatbot tab at the top of website and find chatbot in the list. Click on the More button and select Profile to go to the chatbot profile.
In the chatbot profile, Common section contains the URL address of Messaging endpoint. It must be copied and pasted into appropriate field during a registration of chatbot on the Azure portal.
In Channels section, click on Add to add an available BotFramework.com channel to the list of connected channels. After that, click on Edit to get into channel configurator.
At configurator of the BotFramework.com channel, you must enter the credentials - Application ID and *Application password* - of your chatbot, copied on the Azure portal.
How to get Application ID and Application password you can find out here.
Next, in Channels section of the chatbot profile, switch status Published of the channel BotFramework.com to On state.
Then click on Publish to publish our chatbot.
Received notifications that the channel and chatbot were published. Now chatbot can be used by others.
In Common section of your chatbot's profile, you can always check its publication status by looking at Current status.
If you no longer want others to have access to your chatbot, you can unpublish chatbot in its profile. Just click on Unpublish.
Before you connect your chatbot to various Azure portal channels, you can test its work with integrated web-chat.
To do this, go to our chatbot on the Azure portal: 'Resource groups > ACService resource > ACService chatbot'. Then, on the left panel of chatbot window select Test in Web Chat menu in Bot management section. Next, will be opened a window with a web-chat where you can check whether the publication on the ChatbotLab platform is correct and communicate with your chatbot.
Open our chatbot on the Azure portal: 'Resource groups > ACService resource > ACService chatbot'. Then in the left panel of chatbot window select Channels menu in Bot management section. Select Telegram in More channels section. In channel settings, insert the token received from Telegram messenger in Access token field. Click Save.
Telegram channel is connected!
The chatbot is accessed through a Facebook Page. If you do not have it yet, you can create it here.
First of all we need to create new Facebook App. Enter the name of our App: "ACService" and click on Create App ID.
On Product Setup page of the app find Messenger line and activate Facebook Messenger in application by clicking on Get Started .
Then, need to set up Webhooks for the Messenger:
On the Azure portal, go to channel menu of our chatbot: 'Resource group > ACService resource > ACService chatbot> Channels (in Bot management section on the left panel of chatbot window)'. Select Facebook Messenger in More channels section, and in channel settings, copy values in the Callback URL and Verify Token fields.
Paste these values into the appropriate fields of New Page Subscription in Facebook App. And select in Subscription Fields the following items: messages, message_deliveries, messaging_postbacks, and messaging_optins. Click on Verify and Save.
Next, generate Page Access Token by selecting target page from the list. Copy received token.
Fill in the fields of Facebook Messenger credentials on the configuration page of Facebook Messenger channel.
- Paste copied Page Access Token in the appropriate field.
- Facebook App ID and Facebook App Secret you can find on Dashboard tab on the Facebook App page.
- Facebook Page ID can be found in More info section of “About” of the target Facebook Page.
After all required fields are filled in, click on Save.
Facebook Messenger channel is connected!
Let's test the work of connected chatbot channels in Telegram and Facebook Messenger.
- Go to the chatbot’s Channels menu on the Azure portal: 'Resource group > ACService resource > ACService chatbot> Channels (in Bot management section on the left panel of chatbot window)'. In Connect to channels section click on name of the connected channel - Telegram - and go to our chatbot “ACService_Bot” in Telegram messenger.
- Click on Start, welcome the chatbot and try to make a request for a service.
Telegram channel works!
- In chatbot’s Channels menu on the Azure portal, click on name of the connected Facebook Messenger channel in Connect to channels section and go to the page of conversation with our chatbot “Air Conditioning Service” in Messenger.
- Click on Start, welcome the chatbot and try to make a request for a service, answering chatbot questions.
Facebook Messenger channel works!
In this way, you can run the same chatbot once created on our website simultaneously on several platforms.