my question is about How to deploy Node.js bot to Azure using Visual Studio Code? I have created app service using Visual studio code extension "AZURE APP SERVICE", but it is a website, how to deploy bot code?
-
I believe the bot is deployed on to the app service so it can host the bot.Jon– Jon2018-04-07 02:07:59 +00:00Commented Apr 7, 2018 at 2:07
-
3Your node.js bot is nothing different than app, simply deploy it as web-app and it will work.Anirudha Gupta– Anirudha Gupta2018-04-07 03:27:45 +00:00Commented Apr 7, 2018 at 3:27
2 Answers
It sounds like you've got a bot set up on your personal machine already, if the website you have generated includes an endpoint
/api/messages
It will function as a bot. If you haven't successfully created a bot on your local machine use the node.js tutorial here
In order to use Azure, access the Azure portal and create a web app bot resource via
'Create a resource' > 'AI + Machine Learning' > Web App Bot
Fill out this form with your bot's name and your subscription and resource group in Azure. Generally, it's good to select locations that are close to your customers. You can select any nodejs template, as it will be overwritten by your first deployment. Wait for your bot to finish generating on Azure portal.
Click on the Azure Tab in visual studio code. There should be a blue arrow that reads "deploy". Click on this and you will be prompted to log in to Azure. After signing in, select the folder that contains your bot, and select your subscription, and then select the Azure portal bot you generated earlier. This will deploy your bot to Azure, and it will be accessible within its blade on your dashboard.
For more info on deployment see the Azure App Service documentation.