Comments (4)
I have the same issue. If you browse the BOT's Web App URL (https://xxxxxxxxxxxxxx.azurewebsites.net/api/messages), you will get a 404 error. This is most likely the cause of the issue. Standard troubleshooting requires redeploying the bot. I am still trying to figure how to do that since we deployed this bot through the template. I do not want to redeploy the whole template again.
from microsoft-teams-faqplusplus-app.
It is expected that a browse to the /api/messages to return 404 because the endpoint accepts only POST requests. See this SO thread for detailed explanation: https://stackoverflow.com/questions/50480422/c-sharp-bot-framework-resource-not-found-error
Also, you could test the same thing for a working bot: take the messaging endpoint from the Azure portal and paste it into a browser window.
You will have the same outcome: 404.
Example: working bot:
and the not found page:
from microsoft-teams-faqplusplus-app.
Hi @DanPerfect
For teams:
The bot is responding in teams if the tenantId of your Teams is the same as the one in your Azure subscription.
The code checks the turnContext tenant id to be equal to the id which is present in the appsettings.json and the web.config:
public override Task OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken = default(CancellationToken))
{
if (!this.IsActivityFromExpectedTenant(turnContext))
{
this.telemetryClient.TrackTrace($"Unexpected tenant id {turnContext.Activity.Conversation.TenantId}", SeverityLevel.Warning);
return Task.CompletedTask;
}
https://github.com/OfficeDev/microsoft-teams-faqplusplus-app/blob/master/Source/Microsoft.Teams.Apps.FAQPlusPlus/Bots/FaqPlusPlusBot.cs
You could comment out the above if statement and redeploy the bot in Azure using these steps
https://social.technet.microsoft.com/wiki/contents/articles/52864.visual-studio-2019-publishing-bot-application-to-azure.aspx
For the test in webchat:
This bot is designed to work in teams, because it does some checks on the conversation type:
protected override async Task OnMessageActivityAsync(
ITurnContext turnContext,
CancellationToken cancellationToken)
{
try
{
var message = turnContext.Activity;
this.telemetryClient.TrackTrace($"Received message activity");
this.telemetryClient.TrackTrace($"from: {message.From?.Id}, conversation: {message.Conversation.Id}, replyToId: {message.ReplyToId}");
await this.SendTypingIndicatorAsync(turnContext);
switch (message.Conversation.ConversationType)
{
case "personal":
await this.OnMessageActivityInPersonalChatAsync(message, turnContext, cancellationToken);
break;
case "channel":
await this.OnMessageActivityInChannelAsync(message, turnContext, cancellationToken);
break;
default:
this.telemetryClient.TrackTrace($"Received unexpected conversationType {message.Conversation.ConversationType}", SeverityLevel.Warning);
break;
}
}
When testing in webchat, this returns null
message.Conversation.ConversationType --> null.
Thus, the above switch goes to the default branch.
See here the conversationtype example (personal and channel): https://docs.microsoft.com/en-us/microsoftteams/platform/concepts/bots/bots-notifications#schema-example-bot-added-to-team
To troubleshoot, you may download the bot code from here https://github.com/OfficeDev/microsoft-teams-faqplusplus-app
Run it locally and add a breakpoint in the OnTurnAsync method, main bot class
Test it using the emulator.
Please see this link on how to debug https://docs.microsoft.com/en-us/azure/bot-service/bot-service-debug-bot?view=azure-bot-service-4.0#debug-a-c-bot-using-breakpoints-in-visual-studio
Start by commenting the tenant id validation, if you do not have teams and azure in the same tenant.
The bot should work in teams. I did not manage to make it work into the chat, because of the above switch going to the default branch.
Hope this helps.
from microsoft-teams-faqplusplus-app.
I blew away the bot and started again. This time I'm getting replies. :)
from microsoft-teams-faqplusplus-app.
Related Issues (20)
- Problems to implement SendCardToTeamAsync method HOT 2
- FAQ Plus V2 Bot not responding correctly HOT 1
- ARM deployment fails for github deployment HOT 1
- Can't sign in to the configuration app: Response_type 'id_token' is not enabled for the application HOT 1
- Web Channel Availability HOT 1
- deployment failed with conflict error. i've run this several times witht he same issue. i've followed the directions explicitly. any assistance is appreciated HOT 2
- Should allow send voice records HOT 1
- Something Went Wrong HOT 1
- BOT is not responding
- Fehler beim Lesen von manifest.json: Ungültige Werte für validDomains[0] angegeben: „https://tenant.sharepoint.com“
- Remove 'Ask an Expert' button HOT 1
- Multi-languages support
- Issue on AdaptiveChoiceSetInput design, on mobile app dropdown first value having strike line, when we tab on it
- Can not send SmeTicketCard to expert Teams channel - Operation returned an invalid status code 'Forbidden'
- Multi-turn doesn't handle options V4
- This repo is missing important files HOT 3
- Multi Team HOT 1
- Teams link not working in Bot config App HOT 1
- Usage in multiple tenants HOT 1
- Expert bot side not showing list of tickets HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsoft-teams-faqplusplus-app.