getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.1k stars 4.2k forks source link

Microsoft Teams Integration Problem #66130

Closed klavdijS closed 7 months ago

klavdijS commented 8 months ago

Environment

SaaS (https://sentry.io/)

Steps to Reproduce

  1. Following your MS teams instructions, I have added the the Sentry bot to a team.
  2. I have completed the integration with the Complete setup message I get from the bot: image
  3. Afterwards I try to set Alerts, but I get no MSTeams possibility in the create rule interface: image

Expected Result

I expect the possibility to select the MSTeams action in the dropdown, like shown in the documentation: https://docs.sentry.io/product/integrations/notification-incidents/msteams/

Actual Result

Actual result:

image

Product Area

Settings - Integrations

Link

No response

DSN

No response

Version

No response

### Tasks
getsantry[bot] commented 8 months ago

Assigning to @getsentry/support for routing ⏲️

getsantry[bot] commented 8 months ago

Routing to @getsentry/product-owners-settings-integrations for triage ⏲️

Dhrumil-Sentry commented 8 months ago

Hi, Did you try out the callout mentioned here : https://docs.sentry.io/product/integrations/notification-incidents/msteams/#alert-rules

If Microsoft Teams is not appearing as an option in issue alert actions, re-install the integration using "Add to team".

nickittynack commented 8 months ago

We are having this issue too, even after selecting "Add to team". The integration appears in the list of integrations but never appears inside the Alerts options. We also never receive the welcome option. We have removed the app and re-added multiple times to test.

image
klavdijS commented 8 months ago

Hi, Did you try out the callout mentioned here : https://docs.sentry.io/product/integrations/notification-incidents/msteams/#alert-rules

If Microsoft Teams is not appearing as an option in issue alert actions, re-install the integration using "Add to team".

Yes, we have tried this multiple times. Always no successful result.

leedongwei commented 8 months ago

We'll have the team investigate.

donaldpipowitch commented 8 months ago

Same problem:

neffsvg commented 8 months ago

We are unable to connect sentry and teams to send out alerts into teams channel. We tried several times to uninstall and install again using "add to team".

Then reached out to Sentry Support and got the following answer: "[...] MS Teams Tenants are not yet supported for Issue Alerts [...]". Including a link to this issue.

Is this a bug or a missing of feature?

nickittynack commented 8 months ago

@neffsvg we have had the integration set up for a different tenant for years without issue and it continues to work for that tenant. It seems like there's an issue with the initial set up for a tenant that we're experiencing in this thread. Placing my faith in @leedongwei 🙏

Dhrumil-Sentry commented 8 months ago

@ykamo001 @leedongwei Another potentially related issue here: https://github.com/getsentry/sentry/issues/66678

ykamo001 commented 7 months ago

There is currently a limitation on tenant installation types for integrations, which affects Microsoft Teams. We are looking into this limitation to get more answers, thank you for the patience!

EL-Kush commented 7 months ago

I am also struggling with same issue in teams, I have installed the app, but I want it on my teams channel which is private, so will it not allow for that?

nickittynack commented 7 months ago

I am also struggling with same issue in teams,

I have installed the app, but I want it on my teams channel which is private, so will it not allow for that?

We're currently waiting for the sentry team to test the fix. They've merged one in recently here https://github.com/getsentry/sentry/pull/67196#issuecomment-2005123315.

Our team is currently unable to get production alerts into Teams. We're toying with webhooks or piping Sentry alerts into Jira and getting Jira to notify us - hoping we don't have to do that!

Dhrumil-Sentry commented 7 months ago

@ykamo001 is actively working on fixing this problem, we will share more updates here as we know more, Sorry for the inconvenience 🙏

ykamo001 commented 7 months ago

Hey everyone, thank you everyone for your patience on this issue. I was able to fix the problem, and everyone should be able to install the bot into teams, even if you have a tenant/personal installation. Once you add the bot to the channel or team of your choice, you will then be able to use the bot in issue alerts!

I am attaching two videos on the steps as an example, as I just added the bot to my own MSTeams. Please see next comments for videos

Steps if you have already unsuccessfully tried installing the bot to a channel or team:

  1. Go to Manage Apps (at the bottom left hand side) Screenshot 2024-03-22 at 4 41 26 PM
  2. Find the Sentry app
  3. If you have already tried to unsuccessfully add the bot to a team/channel, delete/remove the bot the channel Screenshot 2024-03-22 at 4 42 05 PM
  4. Proceed to next steps below

Steps to add a bot to a team or channel if you have already installed it personally (Tenant):

  1. Go to Apps and search for Sentry Screenshot 2024-03-22 at 4 44 24 PM
  2. Click on Sentry app Screenshot 2024-03-22 at 4 44 55 PM
  3. Click on the drop down arrow and hit Add to a team Screenshot 2024-03-22 at 4 45 27 PM
  4. Add the team or channel of your choice
  5. Wait for a message to be posted to your newly selected team/channel Screenshot 2024-03-22 at 4 46 16 PM
  6. Click on the setup link and follow the installation steps
  7. Finished!

Once you have successfully added the bot and finished the setup, you will be able to see the option to add Microsoft Teams for an action in Issue Alerts.

ykamo001 commented 7 months ago

https://github.com/getsentry/sentry/assets/5581484/01e99824-aef5-4f69-86d0-7565abe6d50d

ykamo001 commented 7 months ago

https://github.com/getsentry/sentry/assets/5581484/7a2b80fd-06e4-4e66-a1a5-dd0376107114

nickittynack commented 7 months ago

Awesome @ykamo001 ! I have successfully added this to our teams Teams team channel and verified it with a test alert. Will test it more on Monday. Thank you for getting this resolved!

iRod3s commented 7 months ago

@ykamo001 Thank you for the update!

I made it work, but only after "downgrading" to the legacy version of Teams. If In try from the MSTeams (New), the configuration message is never sent.

donaldpipowitch commented 7 months ago

For me it still doesn't work. I created a new team inside Teams and used Teams New, Classic and the Web Version, but I never get the "Welcome" message. We already have an existing integration and could setup up the bot in two teams some years ago, but it doesn't work for new teams.

By the way I don't know it it's related, but when I do this and then want to write a post there is a "Sentry" comment already prewritten.

image

If I post it, it looks like this:

image
xdemiansmithx commented 7 months ago

Same here @donaldpipowitch I removed all apps, integrations and bots, added the Sentry app to a specific channel in a team. Teams goes to the "General" channel, but no welcome message is received at all, so w'ere still stuck. The same for an app integrated via https://dev.teams.microsoft.com/bots

ykamo001 commented 7 months ago

@ykamo001 Thank you for the update!

I made it work, but only after "downgrading" to the legacy version of Teams. If In try from the MSTeams (New), the configuration message is never sent.

I think I know what's happening here, let me quickly resolve this

ykamo001 commented 7 months ago

@donaldpipowitch @xdemiansmithx I'm sorry about that experience, I think I know what's happening, let me quickly verify and push something out. I'll message here when it's deployed and you can try again

ykamo001 commented 7 months ago

@iRod3s I was actually able to get the notification with the new version of MSteams, and with a private channel too. Could you send us what steps you're taking (text or video is fine)?

https://github.com/getsentry/sentry/assets/5581484/dbd276b4-f368-4cc0-9546-183c3983075b

iRod3s commented 7 months ago

@ykamo001 I don't know why, but today is working like a charm in both versions... When trying to fix it, I must have made some change in parallel to downgrading the Teams version, and that's why I attributed the resolution to that. Sorry for the false lead :(

Dhrumil-Sentry commented 7 months ago

Hi All, We're closing the issue for now. If you still face problems, please comment here and we will reopen the issue.

donaldpipowitch commented 7 months ago

If you still face problems, please comment here and we will reopen the issue.

Still facing issues. I just tested it. @ykamo001 said he has an idea what could be wrong and that he would write when it's deployed.

donaldpipowitch commented 7 months ago

I saw that a fix was mentioned in https://github.com/getsentry/sentry/issues/66678 and just tried it out. I now got a welcome message and I can complete the setup. Thanks!

xdemiansmithx commented 7 months ago

I followed this fro mscratch: https://develop.sentry.dev/integrations/msteams/

@ykamo001

still no luck with "complete setup" after the app shows in "built for your org" -> "add to team". When using the "native" sentry app, I did get the "complete setup" but it links to sentry.io and there's no way of changing it to our self hosted instance...

I can see the api nstalled via graph api though: image

ykamo001 commented 7 months ago

That's awesome, thank you @donaldpipowitch! I was waiting for the deployment and then forgot to update here, but glad you are unblocked.

@xdemiansmithx I'll get you more answers for self-hosted

ykamo001 commented 7 months ago

@xdemiansmithx I don't think you can use MSTeams App with self-hosted. You are downloading and using the production Sentry app from Microsoft Store, which points to production Sentry. The documentation should probably be updated, but that app is not supported for self-hosted, since it is configured to point to production out of the box, and there's no way to change the configuration of an app downloaded from the Microsoft store.

You might just be able to create your own internal integration app in Sentry, and then create a personal app in microsoft teams that points to the msteams webhook urls? But none of that is documented right now or officially supported.

xdemiansmithx commented 7 months ago

Thanks for those insights @ykamo001 - I am slightly more confused now, we for sure used the "bot integration" in the past (up to some weeks ago). Only when the credentials expired, and we tried to replace them did we run into this issue (namely, the teams channel was not selectable in sentry anymore). With the developer integration document we're not suing the "Sentry" app from the Teams app store, but it is setting up your own bot, which also should trigger the "Complete setup" dialogue but sadly does not.

ykamo001 commented 7 months ago

Thanks for those insights @ykamo001 - I am slightly more confused now, we for sure used the "bot integration" in the past (up to some weeks ago). Only when the credentials expired, and we tried to replace them did we run into this issue (namely, the teams channel was not selectable in sentry anymore). With the developer integration document we're not suing the "Sentry" app from the Teams app store, but it is setting up your own bot, which also should trigger the "Complete setup" dialogue but sadly does not.

Sorry for the late reply @xdemiansmithx , I think I understand what you're saying. You're not using the official app from the store, but your own integration pointed to your self hosted app. Did you update your self hosted with the changes I pushed recently (linked to this issue)? There were changes on the sentry server/repo side that were blocking/dropping/delaying event processing which was leading to the issue you described.

xdemiansmithx commented 7 months ago

@ykamo001 no worries about the delay, I am highly appreciative of the provided support. I will talk to "the sentry" people to see whether the change was pushed and will revert back to you shortly.

ykamo001 commented 6 months ago

Hey @xdemiansmithx, just checking in! Any other support or help needed?

xdemiansmithx commented 6 months ago

Hej @ykamo001 thanks very much for the follow-up. We haven't been able to progress here due to our infrastructure, so please go ahead and "close" my question for the time being.

Thanks a lot for the support!