How do I manually deploy Bot Framework SDK chatbot to Azure - azure

I need to deploy a number of chatbots in Azure.
I made the botcode for the chatbots and tested them in the Bot Framework Emulator. Now I am ready to deploy them to Azure.
I haven't done this for a while. In the past, I used to create a resource called Web App Bot for this and deploy the botcode via Github.
This would give me a webapp bot resource and an app service that I could deploy my botcode to. Worked like a charm. This resource is not available anymore.
I did find a resource called Azure Bot. There is however no option to deploy any botcode to that resource.
I tried to create all resources via composer -> error and the request to file this in github
I tried to use Azure Cli -> error without any clear explanation.
Is it possible to just manually create all resources to host a Bot Framework chatbot on Azure and what are these steps?
Update 13 feb
I Created a Webapp for my botcode by just cloning a Webapp (from an earlier Web App Bot deployment) and changed the github repositiy. That works.
Next I created a Azure Bot. Changed the url to the url of the app and added api\messages to it.
Testing the bot results in:
Azure bot Webchat channel status overview:
"There was an error sending this message to your bot: HTTP status code InternalServerError"
Web App console:
"Error: Unauthorized. Invalid AppId passed on token"
So I added the Azure Bot's AppId (MicrosoftAppId) to the configuration of the WebApp.
Azure bot Webchat channel status overview:
"There was an error sending this message to your bot: HTTP status code InternalServerError"
Web App console:
"Failed to query knowledgebase: object Object UnhandledPromiseRejectionWarning: Error: BotFrameworkAdapter.processActivity(): 500 ERRORError: The clientSecret parameter is required" I guess I also need to add the MicrosoftAppPassword.
Press Manage Password in the configuration blade of the Azure bot -> Insufficient privileges to complete the operation.
Update 15 feb
6. I managed to create a new secret by visiting the Appregistration itself. Not being able to click Manager Passwords is a bug (I think)
I added to 2 application settings in the Web Appp. One for MicrosoftAppId and one for MicrosoftAppPassword (the secret). As value For the first setting I used Application (client) ID from the app registration
For the second I used the value of the secret I created in the app registration
Done. A working bot deployment

Related

There was an error sending this message to your bot: HTTP status code NotFound error in test in web chat

I have created a simple empty nodejs chatbot with azure compose. And then created a resource group and published it to azure.
I have followed these 2 links
Create a weather chatbot - https://learn.microsoft.com/en-us/composer/tutorial-create-weather-bot#create-a-new-dialog
Deploy the chatbot to azure - https://learn.microsoft.com/en-us/composer/how-to-publish-bot?tabs=v2x
But I was getting the error HTTP status code NOT Found error.
I tried all the StackOverflow solutions available online none of them worked.
I have deployed a Weather chat-bot to azure using below steps
I have Created a Weather chat-bot using composer using the Document that you have provide in the above DOC.
It is working in local environment as below
Now you have to deploy to azure portal from the composer for that follow the below steps.
Click on Publish and select manage profile as below.
Click on Add new as below.
Goto Crate new resource and click on Next as below.
Fill the all the required details as below and click on Next.
After creatin the manage profile and select the profile as below.
Click the check box that bot that you want to deploy to azure portal as blow and click on publish selected bots.
After deploying to azure open resource and click on bot application in azure portal navigate to test in web chat and it's working as below.
If you deploy it through the Bot composer it will automatically assign the application in sights to your Bot app below is the sample Add telemetry to your bot - Bot Service | Microsoft Learn
For More details refer this link follow the step-by-step procedure.

Additional Steps to Deploy C# Teams Messaging Extension (Bot) to Azure?

I have used the Bot Builder Teams messaging extension sample and successfully debugged the project locally on my machine using ngrok. I then proceeded to follow the Azure deployment instructions, and successfully deployed my bot project to Azure.
However, I cannot find instructions regarding what values need to change within my project to now use the assets within Azure. I have enabled the Teams channel on the Bot Channel Registration resource that was provisioned, and I tried updating the botId value within my project's manifest file to match that of the newly provisioned app registration. But I'm still receiving an 'unable to reach app' message when sideloading the app in Teams.
Are there instructions regarding how/what to change within the project so it uses the Azure assets rather than my local ones?
To narrow down what's wrong, have you tried using the Web Chat to test the bot ? If this works, then the bot is working fine in Azure and the issue is for local teams to reach Azure.
Also verify that you are using the right AppID and Password.
Once you have verified that the bot is working in Azure, at the bottom of this page, you will see steps to get a url that you can paste to get the bot added in your local MS Teams instance. (quoting below for quick access)
Copy the https part of the code that is shown in the Get bot embed code dialog. For example,
https://teams.microsoft.com/l/chat/0/0?users=28:b8a22302e-9303-4e54-b348-343232.
In the browser, paste this address and then choose the Microsoft Teams app (client or web) that you use to add the bot to Teams. You
should be able to see the bot listed as a contact that you can send
messages to and receives messages from in Microsoft Teams.
I did finally get my bot working, but found several missing steps within the deployment documentation. I have reported them in a GitHub issue, associated with the relevant documentation article.

Bot service fails with status code:Forbidden

Looks like BOTS which are migrated to Azure as (Bot Channels Registration) are not working. I have hosted them on Azure app service and I see Forbidden while accessing from Cortana. However, there is no trace of error while calling bot from MS team. If I change the messaging endpoint to local ngrok I can work with BOT.
I see the following message in Bot Channels Registration in azure portal.
This bot is migrated from the old Azure Bot Service. You can rollback the migration in order to have access to your old bot before 03/31/2018. After 03/31/2018, the old service will be deprecated.
Is meaning of, old service will be deprecated as if Bot still exist on portal https://dev.botframework.com/bots it will be retired? Then, in that case, Bot Channels Registration (migrated) Bot should work.
Any thoughts on why this started happing since last 2 days?
SDK Platform: Node.js
SDK Version: V3
Active Channels: MS Teams, Cortana
Deployment Environment: Azure App Service

Issue:Test In Web Chat in Azure Bot Service

I am working on Microsoft Bot Framework, I am created the bot through Azure Bot Service in Azure Portal. When I am running my bot application in local emulator its working fine after that published into Azure Bot service.
Here my issue is whenever to test my application in in Azure Portal at Test In Web Chat option the test window will showing like this below.
Added the same bot to Skype channel there also I am not getting any response.
How can I resolve the problem?
Please check your MicrosoftAppID and MicrosoftAppPassword are correctly mentioned in both your BotApplication as well as in Azure Bot Service. Also do check if the same is deployed properly and the MessagingEndpoint is correctly mentioned.
If this was just an issue with the channel your Test in WebChat could have worked properly.
From my experience, it is happen to me with the same situation. I think you select publish as Website. You should select publish as Deployment Script.

published bot on skype but it's not working

I have a bot that I've created by merging LUIS and QnA together in a single project using Microsoft Bot Builder.
I published the bot to an EC2 instance from visual studio and I'm using the Bot Framework Emulator for testing and it works perfectly. (MUST use ngrok for tunneling).
Now I want to deploy the bot on Skype. I logged into the Bot Framework Portal and I registered my bot. Now comes the configuration part.
I'm not quite sure what to set as the HTTP endpoint here.
I found this in the Bot Framework documentation:
Complete the Configuration section of the form.
Provide your bot's HTTPS messaging endpoint. This is the endpoint
where your bot will receive HTTP POST messages from Bot Connector. If
you built your bot by using the Bot Builder SDK, the endpoint should
end with /api/messages.
If you have already deployed your bot to the cloud, specify the endpoint generated from that deployment.
If you have not yet deployed your bot to the cloud, leave the endpoint blank for now. You will return to the Bot Framework Portal
later and specify the endpoint after you've deployed your bot.
When I published from Visual Studio, from the Azure App Service Activity windows, I found this line:
Start Web Deploy Publish the Application/package to https://ec2-00-000-000-00.compute-1.amazonaws.com:PORT/msdeploy.axd?site=bots ...
I used that address for the Messaging Endpoint in the configuration and I published my app. However when I'm testing it on Skype, i'm not receiving any messages from the bot.
I don't know what the problem is exactly, does this have something to do with ngrok? Or am I missing a step here, is there something else I should be doing to deploy the bot on Skype? Maybe something to do with the appid/password that I need to use ... i really don't know
Would really appreciate an explanation of how this works exactly. I don't really understand how the whole deployment procedure works exactly, feels like i'm swimming in murky waters.
Your endpoint is going to be the root of your deployed web application instance, plus the route that your bot is listening on.
For example, one of my bots is deployed to the free version of Azure Web Sites. The URL for a site such as this is https://APPLICATION_NAME.azurewebsites.net and the route that the bot listens on is the default /api/messages. This makes the endpoint https://APPLICATION_NAME.azurewebsites.net/api/messages.
If you connect directly to your app's endpoint, you should at least get a JSON dump with an error message. To make sure your site is getting deployed, drop an HTML file into the root of EC2 and see if you can access this.

Resources