Error when Sending Messages to Skype for Business Bot Framework Bot - botframework

I'm having an issue with a Skype for Business bot in one of my Office 365 tenants. I have multiple tenants and in the first one I was able to add a Skype for Business bot framework bot with no issues. It took awhile for the bot to show up in the directory but it worked. In my second tenant, when I add the bot and attempt to send messages to it (even after 12ish hours of waiting), Skype for Business shows an error under each message I try to send to it - "The action couldn’t be completed. Please try again later." Any ideas what might be going on? One difference between the tenants is that the tenant that isn't working ha a custom domain name, and is using Azure AD Synchronization. Based on some tips I saw I made the address of my bot sip:username#mytenant.onmicrosoft.com rather than using my custom domain name. That didn't seem to make a difference... anyone else encountered this/have any ideas? I also tried leaving off the [BotAuthentication] tag on my MessagesController and that did not make a difference as well.
EDIT: Could this have something to do with my custom domain being federated? That's why I went with mytenant.onmicrosoft.com for the username of the bot.

I was able to resolve this. It seems like it has something to do with when you add a bot to a federated domain utilizing the custom domain name. This errors out when you use the New-CsOnlineApplicationEndpoint -Uri bot#domain.com. However, it still creates a bad endpoint. The cmdlet does not error out if you use a uri like bot#domain.onmicrosoft.com. However, after I had already added the bad endpoint, it seemed like no endpoints would work after that. To resolve, I removed all endpoints, including the first bad one with the uri bot#domain.com. Waited 8 hours, added a single endpoint using the onmicrosoft.com Office 365 domain, waited probably about 12 hours, and it started working.

Related

Teams proactive messages with uninstalled app

I'm trying to build a personal Teams bot which has to send proactive messages regularly. I made it work by storing the conversation when the user installed the app, just like the examples here. Now it works great, but I realized that I keep messaging users that have uninstalled my application. I can't seem to find any event that is triggered when a user uninstalls a personal scoped bot (app).
I tried conversation events, but nothing seems to be triggered for personal scoped bots at least.
I'm using the NodeJs botbuilder SDK.
Open to any suggestions, thanks.
To my knowledge, there is no such event unfortunately. I think you'll just receive a 403 at the moment without much info. This is due to change though - Microsoft just made an announcement about this yesterday in fact. See https://developer.microsoft.com/en-us/office/blogs/best-practices-and-updates-for-bot-lifecycle-events-in-microsoft-teams/ in the paragraph "Changes to post uninstall behavior for bots in personal scope":
Moving forward we’ll also align the post uninstall behavior for bots in the personal scope with the teams and groupChat scopes and you will not be able to send or receive messages after an app has been uninstalled. Your bot will receive a 403 response code to new messages posted by your bot. The 403 response code will have fields telling you the reason behind the it – which is either the app was uninstalled or the bot was blocked. We expect these changes to roll out in the coming few months.

Microsoft Bot send the response twice in Teams

I've used Microsoft bot framework SDKv4, and integrated to Teams channel. It is running well, but giving responses twice.
But, I didn't get the same behavior, while I tested it on Emulator and Web Chat in Azure Portal.
However, I can see below issue, while I ping the bot in web chat and get a response.
Further, I can also see, that its always 'sending' as a status although I got a valid response, and the status later changes to "Send Failed. Retry"
Is the issue related to my teams integration for getting message twice? and how, should I fix it!
Are you using webhooks? If so, having multiple webhooks with same ID could be the reason for double messages. Hope this helps
I made my bot working. It was the issue of MS authentication!
I had a call with MS support person and the root cause appeared to be only the MS authentication. Had to reset app secret and then re-deloyment.
Its weird that, although it was not getting authenticated primarily yet it was returning me the response. This, I still haven't got it!

Error 550 5.7.708 when creating Calendar Events via the Graph API

When creating Calendar Events via the Graph API, the events are created correctly in the calendar of the organizer but the invites to the participants get bounced. The organizer gets a 'Delivery has failed...' message with the following error message:
Remote Server returned '550 5.7.708 Service unavailable. Access denied, traffic not accepted from this IP. For more information please go to http://go.microsoft.com/fwlink/?LinkId=526653 AS(7171)
Sending emails manually through Outlook (web) from the organizer to the participants works fine.
The issue is intermittent. After changing the DNS server, everything worked fine for some time.
I checked https://protection.office.com/restrictedusers as suggested in the answers to similar posts, but this list is empty.
I also tried delisting the IP address (my own?) through https://sender.office.com/, but to no avail.
The tenant is linked to the Microsoft Developer Program and would allegedly have a 'bad reputation'. However, I don't understand how that would explain the fact that it sometimes works and sometimes doesn't when sending exactly the same API request and hence 'triggering' exactly the same emails...
I think the best way to overcome this would be to add a domain to your developer tenant as per the guidance here:
https://learn.microsoft.com/en-us/Exchange/mail-flow-best-practices/non-delivery-reports-in-exchange-online/fix-error-code-5-7-700-through-5-7-750#57750-client-blocked-from-sending-from-unregistered-domain
Add and validate all domains in Office 365 that you use to send email messages. For more information, see Add a domain to Office 365.
I'm not guaranteeing this will resolve it. You have to understand that those developer tenants are only meant for experimentation and so there are checks and balances to ensure they are used in a bad manor.
How many emails are you sending through this tenant?
Calendar events are sent out via email. Add the "Mail.Send" permission to you App Registration.
This solved it for me.

'Oops. Something went wrong and we need to start over.' with Microsoft Bot Service with LUIS Template

I have created a Bot Service with LUIS template using Node.js, I have trained my luis model with our domain utterances and it was working fine. suddenly from a week time , Am facing weird behavior form the Bot Service, for any request the bot is replying as 'Oops. Something went wrong and we need to start over.' message. Could anyone encountered the similar issue and share your inputs to resolve.
Appreciate your help.
When a user query exceeds 500 character Luis gives an error. Check the user message how long it is and then test it in Luis portal. Or please check the subscription key which is used.

Bot framework Unable to use with Skype For Business

I've built a Bot using C#. I tested it using the emulator, web chat, direct line and Skype, and it's working as expected.
I followed the steps to register the bot with skype for business, I waited more than 24 hours to see what's happen.
So far, I can see the Bot as a contact, however, when I try to send a message, the error
"Error happened in Skype for business when reaching bot service. We
saved this conversation. You'll see it soon in the Conversations tab
in Skype for Business and in the Conversation History folder in
Outlook."
Looking for some logs or something, I collected some info, that I'm sharing here.
Analytics from BOT that proves that it's reaching it:
The Log for SFB channel said: "There was an error sending this message to your bot: HTTP status code NotFound"
It's look that the Bot endpoint is not available. When I registered it in SFB, I've been using NGROK (to run agains my machine), but later I've change it to a azure site.
"Old" endpoint is used yet today:
So, all I can guess is that Bot End Point was "registered" at the moment that I made the registration of my Bot in SFB, and now it's not possible to change it.
Does it make sense to anyone of you?
My problem seems to be kind of similar to Bot Framework - An error while sending a message from Skype for Business
Adrián
Ok, I'm sure the problem with the bot was the endpoint registration. I found a powershell script that update the endpoint.
I Opened Windows PowerShell as Administrator and run the ff scripts:
Import-PSSession (New-CsOnlineSession -Credential (Get-Credential))
Set-CsOnlineApplicationEndpoint -Uri sip:username#yourdomain.com
Obviously, I changed username#yourdomain.com with my own.
Then, after waiting 8 hours (or so), I was able to communicate with the bot, using SFB as channel.
Bot running as expected
I hope this can be useful for others.

Resources