Testing bot application in Azure not responding - azure

I’m using Azure Enterprise subscription and created a chat bot using same. But currently, I’m having trouble chatting using it. The bot is created using Visual studio using Bot framework and published to Azure. https://pihitsupportbot001.azurewebsites.net/ is my messaging end-point URL. I made bot channel registration for the same application and used the bot api endpoint with api/messages as end-point for it. Updated web config file with generated app ID and password and published. But when I try testing with web chat in Azure it is throwing ‘couldn’t send retry’. What would be the reason?

Jobin,
I was able to connect the bot emulator from my local pc to your endpoint, https://pihitsupportbot001.azurewebsites.net/api/message without, obviously, your appid and app password. I sent a 'hello' and received a sign-in card response. So, the bot appears to be working fine. Maybe the app service was still restarting after you edited the web.config?
Also, It's very hard to help diagnose these kinds of problems with limited information.

The error was due to the reason In global.asax I didn't have any state specified to store the conversation history. Earlier Microsoft had been providing a default state service for bots built using either the Node.js or .NET SDK’s. The state service is used to store and retrieve user and conversation data within the context of a conversation. But in fact in local while running using emulator or even in IIS, it doesn't need to have it. below is the documentation.
Bot State Service will soon be retired on March 31st, 2018
var store = new TableBotDataStore(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
Conversation.UpdateContainer(
builder =>
{
builder.Register(c => store)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
builder.Register(c => new CachingBotDataStore(store,
CachingBotDataStoreConsistencyPolicy
.ETagBasedConsistency))
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
});

Related

How to connect a published bot to bot channel registration on Azure

I'm new to Azure. I had published a bot (developed locally) to Azure, e.g. named MyBot. It was shown as web service. Then I had created a bot channel registration on Azure e.g. named MyRegistration. As instructed, I wrote down the AppID and client secrete value from MyRegistration. In My Registration->settings, I put https://MyBot.azurewebsites.net/api/messages to the messaging endpoint. In MyBot->Configureation->Application settings, I added "MicrosoftAppId" and "MicrosoftAppPassword" and their values. I turned on "Web sockets" in MyBot->Configureation->General settings. I saved all the changes.
When I run "Test in Web Chat" in MyRegistration, nothing happened. In MyRegistration->Channels, there was "Issues" saying "There was an error sending this message to your bot: HTTP status code InternalServerError".
Can anybody help to point to what the reasons of failure were? Thank you very much.
Not sure the root reason, but I deployed my bot and go through this process but everything works perfectly for me. This is my steps below:
Deploy my bot service to Azure as a web app.
Create a Bot Channels registration, config my bot-message endpoint and Note Microsoft App ID:
Create a new secret, and note its value by clicking "Manage" Link:
Go to app service, and config App ID and App Password
Back to bot channel and have a web test. everything works as excepted:

Service error Bot should use its own storage

I've created bot (Bot Framework v3) which uses LUIS, QnAMaker, Dialogflow services. It works perfectly when I run it locally in the Bot Emulator, but when I deploy it on Azure my bot stops working. On the surface he just replies Sorry, my bot code has an issue and in the Settings-Web Chat blade of the application there is a 500 InternalServerError.
I tried to debug with ngrok, and I got an exception Operation returned an invalid status code 'MethodNotAllowed' with Microsoft.Bot.Connector.ErrorResponse message Bot should use its own storage in my MessageController in method await Conversation.SendAsync(activity, () => new RootDialog().DefaultIfException());
Also, the first message that was intended to be sent by the bot which is processed in ConversationUpdate is successfully sent to a user without any error.
I'm using Azure Table Storage, and I've also tried InMemory storage. There is also some work with a local database in my bot.
I also have a web app bot that was created a few months ago, and I tried to deploy this bot and it works fine. So, I suppose maybe I missed something in this new web app bot configurations or there is some other issue I'm not aware of. I've already checked all my app service keys many times.
Any help will be appreciated!
So, I found a solution. You must be sure that you have these lines of code in your Global.asax file
builder.Register(c => store)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
builder.Register(c => new CachingBotDataStore(store,
CachingBotDataStoreConsistencyPolicy
.ETagBasedConsistency))
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
and use either Azure Table Storage or CosmosDb.
I just hadn't use CachingBotDataStore and its absence caused the error.

Installing a bot in Microsoft teams, the bot name is the Azure host not the bot name specified in the mandate

I have deployed a custom app in teams, which is an Azure hosted bot framework chatbot. To install I used teams "App Studio" app, where under "Bots" I selected my existing bot. I deployed to a specific team. Everything works perfectly, apart from the actual name of the bot in teams. Instead of the user being able to start a chat with the chatbot name #Dave, they have to start using the Azure host name #prodserver123. Anychats with the bot then display the bot messages as coming from #prodserver123.
I have gone through the manifest, the chatbot name is specified as #Dave everywhere, and the BotId on Azure is also #Dave.
Does anybody know how I might be able to resolve this please?
For sidealoaded apps Bot name and icon is taken from Bot Service. For apps which are published in Teams App Store, the Bot informatin is fetched from app manifest.
Also, Bot names are cached and that could be the reason you don't see updated name. Please sign out and sign in to clear out the cache.

Azure Web App Bot - Cortana Invocation name exists

An old Azure Web App Bot with a Cortana binding has an invocation name I would like to use on my new Web App Bot. However, I received following error
Skill with display name 'myawesomebot' already exists for this market. Trace
ID : 873xxxxx-xxxx-xxxx-xxxx-xxxxcxxxxxxx
Thus, I removed the old Web App Bot (deleted all resources), but still, this error message appears. Is there a time delay, or am I missing something?
If you didn't delete the channel first, the channel connection will be orphaned when you delete the web app bot. Send me a note at skillsup at microsoft dot com with the invocation phrase and I'll get it fixed. We're working on a general fix (but I can't promise an ETA).

How to store configuration items in a Slack App

How do you store permanent data in a Slack Application?
For example, the Opsidian slack app has a command to add your AWS keys. Where does it store those keys and how does it know to use specific keys for specific teams?
Is this on the Opsidian side? If that's the case does it just use the team.info endpoint and use that every command to match it up?
I have searched their documentation and Google with no luck.
A slack app usually consists of program code (e.g. PHP) and a database (e.g. MySQL) that runs on a server and interfaces with Slack through one of the APIs. All Slack team specific information is stored in a custom datadase using the unique team ID as key. The server needs to be accessible from the Internet, so that Slack can communicate with it. The server to run the program code of the app and the custom database for the app is not provided by Slack, but needs to be setup and maintained by the Slack app developer.
Slack itself only stores the basic configuration for an app (everything you see under "Your apps", e.g. Validation token) and some basic configuration per team after installation (e.g. That an app is installed and who installed it). Any other application specific information has to be stored by the app itself in its database.
The Slack app developer also needs to provide a custom website to allow installation of a Slack app for a team. See this answer for more info about the installation process and how to obtain a team specific access token.

Resources