Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onMembersAdded Event Not Triggering on an App Service with Authentication Enabled #1380

Open
hirokika opened this issue Sep 1, 2024 · 4 comments
Assignees

Comments

@hirokika
Copy link

hirokika commented Sep 1, 2024

Hi,

I am developing a notification bot in TypeScript based on the Teams Toolkit sample code.

I use the NotificationBot#findMember method to identify users and send notifications to those who have installed the bot.
https://learn.microsoft.com/en-us/javascript/api/@microsoft/teamsfx/botbuildercloudadapter.notificationbot?view=msteams-client-js-latest

Everything was working fine until I enabled Microsoft IdP authentication on the App Service for access control. Since then, the bot has stopped sending notifications.

While investigating the issue, I tried logging a message to the console when the bot is installed, but noticed that no messages are output when authentication is enabled. Below is an example of the debugging code:

this.onMembersAdded(async (turnContext, next) => {     
   await turnContext.sendActivity("Welcome!! You can receive notifications.");     
   await next();  
});

It also appears that the bot is not writing the user’s connection information to the connected storage.

Could there be any possible causes for this?
When adding the bot in Teams, do I need to explicitly allow the request?
If so, could you please provide the specific configuration steps?

@Nivedipa-MSFT
Copy link
Collaborator

Nivedipa-MSFT commented Sep 2, 2024

@hirokika - Thanks for reporting your issue. For installations() API to find targets where the bot is installed.
This API is deprecated now.

image

Ref Doc: https://learn.microsoft.com/en-us/javascript/api/@microsoft/teamsfx/botbuildercloudadapter.notificationbot?view=msteams-client-js-latest#@microsoft-teamsfx-botbuildercloudadapter-notificationbot-installations

Could you please use getPagedInstallations API and check again?

@Nivedipa-MSFT
Copy link
Collaborator

@hirokika - Have you checked with the getPagedInstallations() API? Is your issue resolved with this suggestion, or are you still facing the issue?

@Nivedipa-MSFT
Copy link
Collaborator

@hirokika - Could you please share your valuable feedback via Microsoft Teams Developer Community Response Feedback
link?

@hirokika
Copy link
Author

@Nivedipa-MSFT
Thank you for your response.
I'm using findMember(), not installations(). Does that mean findMember() is also deprecated?
From what I can tell by looking at the reference, it doesn't seem to be the case.
https://learn.microsoft.com/en-us/javascript/api/@microsoft/teamsfx/botbuildercloudadapter.notificationbot?view=msteams-client-js-latest#@microsoft-teamsfx-botbuildercloudadapter-notificationbot-findmember

In the bot I'm implementing, I need to identify the target user based on a specific email address, so I believe findMember() is the appropriate method for this. Is my understanding correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants