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

migrate connector to power platform for msteams #3921

Closed

Conversation

zhan9san
Copy link
Contributor

@zhan9san zhan9san commented Jul 11, 2024

Fix #3920

The summary is marked as DEPRECATED in this PR because there is no appropriate field in Request Body Schema.

Besides, adding support of more flexible Adaptive Cards is not covered in this PR. It may be in another PR.

Migration plan:

  1. Create a workflow from a channel in Teams and get the workflow webhook URL
  2. Replace the connector webhook URL with the workflow webhook URL in AlertManager configuration

Test result

image

Reference

https://support.microsoft.com/en-us/office/creating-a-workflow-from-a-channel-in-teams-242eb8f2-f328-45be-b81f-9817b51a5f0e
https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/

an example json can be used in Postman

{
  "type": "message",
  "attachments": [
    {
      "contentType": "application/vnd.microsoft.card.adaptive",
      "contentUrl": null,
      "content": {
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "type": "AdaptiveCard",
        "version": "1.2",
        "body": [
          {
            "type": "TextBlock",
            "text": "[FIRING:8] LowDiskSpace (CriticalLowDiskSpace foo",
            "weight": "Bolder",
            "size": "Medium",
            "wrap": true,
            "style": "heading"
          },
          {
            "type": "TextBlock",
            "text": "This is some **bold** text\r1. Numbered\r2. List\r"
          }
        ]
      }
    }
  ]
}

@zhan9san zhan9san force-pushed the feature/msteams-power-platform branch 3 times, most recently from a527868 to 0ecc664 Compare July 11, 2024 08:33
@zhan9san
Copy link
Contributor Author

@simonpasquier

Could you please help review this PR?

Do you know why the test run successfully in Github action but failed in CircleCI?

@@ -803,9 +802,8 @@ type MSTeamsConfig struct {
WebhookURL *SecretURL `yaml:"webhook_url,omitempty" json:"webhook_url,omitempty"`
WebhookURLFile string `yaml:"webhook_url_file,omitempty" json:"webhook_url_file,omitempty"`

Title string `yaml:"title,omitempty" json:"title,omitempty"`
Summary string `yaml:"summary,omitempty" json:"summary,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can remove this without a deprecation notice and subsequent deprecation period (for example, scheduled to be removed in the next 3 minor releases).

There are a number of projects that use Alertmanager such as cortex and mimir, and removing this field will break Alertmanager configurations for tenants in those systems. The reason for this is Alertmanager uses yaml.UnmarshalStrict, which will fail if a configuration file contains a summary field.

Instead, we either need to keep it and find a use for it – or keep it, don't use it and document that it's deprecated so it can be removed at a later date.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grobinson-grafana

Thanks for your review.

Good point. I'll keep it and document that it's deprecated.

Copy link

@sandip-rlg sandip-rlg Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @zhan9san @grobinson-grafana , are we going to have the feature released that supports msteams-power-platform anytime soon ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grobinson-grafana

The summary still exists in configuration, but the loaded summary value would not be used in payload.

If there is no concern, feel free to resolve this conversation.

@jkroepke
Copy link
Contributor

Technically, this is an breaking change. Keep that in mind. Not sure if its worth to setup an msteamsv2 connector and deprecate the old one to increase the awareness for end users.

@zhan9san
Copy link
Contributor Author

zhan9san commented Jul 16, 2024

@jkroepke

Thanks for your review.

I don't think v2 is necessary because the original strategy would be abandoned by msteams in a short time window.

The incompatible migration is a must.

https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/

We will gradually roll out this change in waves:

Wave 1 – effective August 15th, 2024: All new Connector creation will be blocked within all clouds

Wave 2 – effective October 1st, 2024: All connectors within all clouds will stop working

@jkroepke
Copy link
Contributor

At least, It worth to mentation that the docs that the connector now requires a Power Automate license.

I'm aware for that situation, however many users maybe not and my create issues here at AM, if wave 2 starts.

@zhan9san
Copy link
Contributor Author

it makes sense.

I am on vacation, and will be back one week later.

I can add this notice in doc when I am back, if it's not urgent.

@chrisipa
Copy link

chrisipa commented Jul 19, 2024

I'm also desperately waiting for this PR to be merged. Thanks for your help and dedication.

Signed-off-by: Jack <jack4zhang@gmail.com>
Signed-off-by: Jack <jack4zhang@gmail.com>
@zhan9san zhan9san force-pushed the feature/msteams-power-platform branch from b571eca to 18ce823 Compare July 31, 2024 04:20
Signed-off-by: Jack <jack4zhang@gmail.com>
@zhan9san zhan9san force-pushed the feature/msteams-power-platform branch from 18ce823 to 7d485f7 Compare July 31, 2024 04:34
@zhan9san
Copy link
Contributor Author

@jkroepke

The license has been updated in doc. Do you still have any concern?

@simonpasquier Could you please help review this PR?

@jkroepke
Copy link
Contributor

@jkroepke

The license has been updated in doc. Do you still have any concern?

The doc is clear. That helps.

You can optionally mention, that as of October 1st, 2024, classical Teams webhooks are not longer supported by Microsoft. including a link to the official blog post.

That may help users, that are not fully familiar with Teams. There are a lot users that may had to integrate msteams as receiver, without been in that eco system.

@pascal-hofmann
Copy link
Contributor

In the meantime the timeline has been changed by Microsoft. See the update at the top at https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/:

Update 07/23/2024: We understand and appreciate the feedback that customers have shared with us regarding the timeline provided for the migration from Office 365 connectors. We have extended the retirement timeline through December 2025 to provide ample time to migrate to another solution such as Power Automate, an app within Microsoft Teams, or Microsoft Graph. Please see below for more information about the extension:
All existing connectors within all clouds will continue to work until December 2025, however using connectors beyond December 31, 2024 will require additional action.
Connector owners will be required to update the respective URL to post by December 31st, 2024.

@jkroepke
Copy link
Contributor

All existing connectors within all clouds will continue to work until December 2025,

At least, they continue to work for more year. From my point of view, the existing receiver should not be changed and a new one should be introduced.

@zhan9san
Copy link
Contributor Author

Instead of introducing a new receiver, I prefer to add an optional flag in the configuration, such as power_automate.

If power_automate is set to false or not set at all, the alerts will be sent to the Webhook connector.
Only if power_automate is explicitly set to true, will the alerts be sent to the Power Automate platform.

Let me know your thoughts.

@grobinson-grafana
Copy link
Contributor

Instead of introducing a new receiver, I prefer to add an optional flag in the configuration, such as power_automate.

If power_automate is set to false or not set at all, the alerts will be sent to the Webhook connector. Only if power_automate is explicitly set to true, will the alerts be sent to the Power Automate platform.

Let me know your thoughts.

I'm not sure about this because it will mean we need to transition users a second time to remove the flag once power automate becomes the only working option and we want to remove the flag.

@zhan9san
Copy link
Contributor Author

I get your point.

How about using webhook_connector flag?

true: webhook connector
not set: power auto platform

After the webhook connector is retired, the users would have to migrate to power auto platform. The we can remove the flag at any time.

It's a one time change for power auto platform user.

For users who still want to use webhook connector, they have to set it to true explicitly after upgrade, and migrate to power auto platform next year.

@jkroepke
Copy link
Contributor

they have to set it to true explicitly after upgrade

Thats an breaking change.


What the issue with and v2 notifier which brings the best possible user experience? Why so complicated?

From maintainer point of view, it's much easier to just remove an whole notifier in a year.

Creating an notifier which support both feel counterintuitive. For example, the summary property has no effect, if power flows are used. This my confused people. Then, new property needs to be introduced which must mark instantly as deprecated. Having both logics in one notifier increases the complexity on code.

@zhan9san
Copy link
Contributor Author

zhan9san commented Aug 1, 2024

It's okay. I'll add a new receiver.

@zhan9san
Copy link
Contributor Author

zhan9san commented Aug 2, 2024

I hope you don’t mind, but I would greatly appreciate another opportunity to discuss this.

There are two services: Webhook Connector and Power Automate.

I attempted to add a new receiver, but I found that detecting the service via URL is much more straightforward.

brings the best possible user experience

If we detect it automatically, the only thing users need to do is to change the URL.

Reference: https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/?commentid=1101#comment-1101

@grobinson-grafana
Copy link
Contributor

I'm afraid I don't see how that makes it more straightforward? What do you plan to do with the summary field when the URL matches the regex logic.azure.com? What if Microsoft change the URL in future, or start to use different URLs for different Teams accounts?

@sschne
Copy link
Contributor

sschne commented Sep 5, 2024

Is this still being worked on, or should i take this over?

@zhan9san
Copy link
Contributor Author

zhan9san commented Sep 6, 2024

@sschne

Feel free to take it. Thanks.

@grobinson-grafana
Copy link
Contributor

This can be closed in favor of #3920.

@zhan9san zhan9san closed this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Microsoft deprecating Teams webhooks, new "Workflows" uses incompatible schema
7 participants