Using:
When testing the bot in Bot Framework Emulator V4, it does work as expected as it can be seen in the next figure:
After Deploying it in Azure following this instructions, bot stops working (neither sending or receiving messages) and got this alerts in the webchat channel section:
I've found these similar issues:
https://github.com/Microsoft/BotFramework-Emulator/issues/296
https://github.com/Microsoft/BotBuilder/issues/3329
But in my case both AppId and Password are defined and the other solution simply doesn't work at all. I even managed to find the error codes on the azure platform, but I was unable to find the details or get where the error is coming from...
public async Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken = default(CancellationToken))
{
bool reintentar = false;
//tried this but didn't work
//MicrosoftAppCredentials.TrustServiceUrl("http://botrps.azurewebsites.net");
//obtener el contexto de los dialogos
var dc = await _dialogs.CreateContextAsync(turnContext, cancellationToken);
if (turnContext.Activity.Type == ActivityTypes.Message && turnContext.Activity.From.Id != turnContext.Activity.Recipient.Id)
{
//bot operations on users messages
}
//if active dialog
await dc.ContinueDialogAsync(cancellationToken);
//else, start greeting dialog
if (turnContext.Activity.Type == ActivityTypes.ConversationUpdate &&
turnContext.Activity.MembersAdded[0].Id != turnContext.Activity.Recipient.Id)
{
await dc.BeginDialogAsync("dialogo", null, cancellationToken);
}
await _accessors.ConversationState.SaveChangesAsync(turnContext, false, cancellationToken);
// Guarda los cambios realizados en el Contexto, si hay alguno
await _accessors.UserState.SaveChangesAsync(turnContext, false, cancellationToken);
}
As said by tdurnford in the comment section, it was necessary to add to the .bot configuration the production enpoint service. The resulting bot file:
{
"name": "BotMod2",
"services": [
{
"type": "endpoint",
"name": "development",
"endpoint": "http://localhost:3978/api/messages",
"appId": "",
"appPassword": "",
"id": "1"
},
{
"appId": "**********************",
"appPassword": "**********************",
"endpoint": "https://**********************.azurewebsites.net/api/messages",
"type": "endpoint",
"name": "production",
"id": "2"
},
{
"appId": "**********************",
"authoringKey": "**********************",
"version": "0.1",
"region": "westus",
"type": "luis",
"name": "**********************",
"id": "3"
},
{
"type": "qna",
"name": "**********************",
"kbId": "**********************",
"hostname": "https://**********************.azurewebsites.net/qnamaker",
"endpointKey": "**********************",
"subscriptionKey": "**********************",
"id": "4"
}
],
"padlock": "",
"version": "2.0"
}