Hosting bot at telegram with Azure using Node.js - node.js

Trying to host my telegram bot with Azure?
Not sure how to proceed
Used Node.js to code

Check the Deploy a bot documentation topic. There you will find the details on how to proceed to deploy to azure.

Related

Azure Test in Web Chat: HTTP status code NotFound

I tried running a new code from Azure Pipelines into Azure Web App Bot, configured the application settings appropriately. Yet whenever I tried to test the service in the test chat web I got errors.
Node version: 10.14.1
botbuilder: 4.10.3
Azure Repos + Azure Pipelines deployment
Application Settings
Test in Web Chat
Error messages
There was an error sending this message to your bot. HTTP status code: not found
To troubleshooting this issue, you could check the following points:
1.Navigate to Settings tab, you need to make sure that the Messaging endpoint is Https instead of Http.
Note: It doesn't support the Http website.
2.Navigate to Channels tab, you could check if the Web Chat is in Running state without issues.
3.Navigate to Configuation, you need to make sure that the MicrosoftAppId and MicrosoftAppPassword do not change these after deploying the new code.
If it keeps getting errors, you can even consider creating a new web app bot to redeploy
On the other hand, this is the document I refer to to deploy azure web app bot.
I deploy the new code to Azure App service with the Azure App Service deploy task.
Result:

Client uses a cached bot version post deployment

Client browser session, on the web channel, displays deprecated dialogs and functionality in recently deployed version. The issue is resolved once cache is purged, am I missing a step or setting in deployment?
I'm using nodeJS SDK4.4 using Kudu for Azure deployment.
Thanks
I've never used Kudu specifically to deploy to the bot framework; the MSBF supports using the AZ CLI to deploy (though this seems to be similar enough, in that it is a "zip deployment"). That being said, it's possible the Kudu deployment method is somehow being delayed.
One option you could try is to enable continuous deployment through Github. It's as simple as authorizing Azure to look at the github repo you have your bot code in.
The Bot Framework has a how-to here.

How to deploy Microsoft botbuilder nodejs app to azure using CLI?

I am trying to deploy the basic-bot Microsoft Botbuilder sample application to azure.
I started by creating a new botbuilder node.js sample application through the Azure dashboard, and I was able to successfully follow the instructions here to download and redeploy the application.
I then attempted to copy over the deploy scripts and .env file from the downloaded sample application into the basic-bot application, and attempted to publish using the az bot publish command from the link above. This successfully deployed the basic-bot application, but the deployed application now returns 500 errors. Initially, the 500 errors were caused by the "botbuilder-ai" nodejs package not being installed. I installed this package manually through the Azure console, and this error went away. But the application continues throw 500 errors, without producing a stack trace, and I have not been able to determine why.
The only official documentation I have found that explains how to deploy the bot is specifically for C# and Visual Studio. Is there a way to deploy a bot to azure for a Node.js app using the azure CLI?
Thank you.
Is there a way to deploy a bot to azure for a Node.js app using the
azure CLI?
Yes there is. You can type az bot publish -h for all the options available to you when publishing a bot. Here are some tips about getting it to work:
You will need to log in to Azure with az login
Make sure you've set an active subscription. Type az account set -h for help. Use az account list to see your choices of subscriptions and az account show to see the current active subscription
Publishing can be easier if you set the resource group you're publishing to as your default. Unlike your active subscription, configured defaults don't reset when you log out. Use az configure to see your current defaults and az configure -h to see how to set a default resource group
If you publish and it says Not a valid azure publish directory. missing post deploy scripts then you'll need a PostDeployScripts folder in your bot folder
There are some instructions in the deploymentScripts folder that you might find helpful. Note that as an alternative to the Azure CLI, you can also publish from Visual Studio Code using the Azure App Service extension.
If you publish successfully and you're getting errors when you try to test in Web Chat, sometimes Azure needs a little nudging. When I checked my Channels blade it said Web Chat was encountering errors regarding missing files. I tried some troubleshooting steps and eventually got it to work without any real changes.
Try logging out of your Azure account in the online portal and then logging back in
Try running your code in the online code editor in the Build blade
Try publishing again
Regarding your specific situation of trying to repurpose the downloaded source code to deploy the basic-bot sample, there are a few things you need to know. The .bot file is very important as it contains information about all the services the bot uses, but basic-bot.bot contains none of the needed information. In addition to the deployment scripts and the .env file you will also need to copy over your .bot file. However, basic-bot's bot.js expects the .bot file to contain a LUIS service named "basic-bot-LUIS" so you need to go into the bot.js code and change the value of LUIS_CONFIGURATION to the name of the LUIS service in your .bot file ("BasicBotLuisApplication" if you downloaded the V4 Basic Bot NodeJS code and kept it the same). Make sure you can get the basic-bot sample to run locally before you try to publish it.

How to Deploy MS Botframework in Python to Azure

I've been playing with Botframework and am trying to upload the sample code from the git https://github.com/Microsoft/botbuilder-python/tree/master/samples/EchoBot-with-State (with minor modifications) to Azure cloud. I've been referring to this link https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-howto-deploy-azure?view=azure-bot-service-4.0
but have not been able to do so. Looks like this guide is more for .NET / .JS based applications and I'm not sure how to use Visual Studio with Python code to deploy to Azure.
I've never used Visual Studio before and any help would be appreciated.
Thanks
As far as my knowledge BOT is app service hosted on Azure. So to publish your bot application you will need to follow the same steps involved in publishing Python web app to Azure.
You can follow steps in below link.
Publishing Python web app to Azure

Can't create a web bot on azure

The screen is stuck with the "Create Blade" message.
Tried both on Chrome and Edge
I don't know why is this happening to you. It's working fine for me.
If you still not able to make it work. Make sure you have enough amount in your Azure subscription (or) your subscription is Active.
However Azure Portal is a simple GUI to create any resources easily. But it doesn't mean to stop you from using other ways like Azure CLI, Powershell, ARM templates, Other SDK's
Azure CLI to create a WebApp Bot
Dot Net SDK to create a WebApp Bot
Node.js SDK to create a webApp Bot

Resources