Skip to content

Fix Logic App template: update triggerBody to data.context for Azure …#14667

Closed
its-abhaykumar wants to merge 1 commit intoAzure:masterfrom
its-abhaykumar:fix/alert-context-update
Closed

Fix Logic App template: update triggerBody to data.context for Azure …#14667
its-abhaykumar wants to merge 1 commit intoAzure:masterfrom
its-abhaykumar:fix/alert-context-update

Conversation

@its-abhaykumar
Copy link
Copy Markdown

Fix Logic App Slack template: update triggerBody to data.context for Azure Monitor alerts

Fixes #14225

Problem

The current Logic App template for posting Azure Monitor alerts to Slack assumes that alert payloads are structured with triggerBody()['context'].

Azure Monitor now sends alert details under data.context following the Common Alert Schema. As a result, Slack messages were missing key alert information or failing.

Solution

  • Updated all references in the template from triggerBody()['context']triggerBody()['data']['context']
  • Updated both the URL shortener HTTP action and Slack post message action
  • No breaking changes to existing ARM template structure

Testing

  • Deployed template in a test resource group
  • Sent a sample Azure Monitor payload:
{
  "status": "Activated",
  "data": {
    "context": {
      "name": "Test Alert",
      "portalLink": "https://portal.azure.com/#resource/test",
      "resourceName": "MyResource"
    }
  }
}

@alex-frankel
Copy link
Copy Markdown
Contributor

Thanks for your contribution. We're closing stale PRs (no updates in 90+ days) as we transition to the new CI process — see #14715 for the new submission requirements. If you'd like to continue with this change, please rebase against master, ensure the new testResult block is populated in metadata.json, and reopen this PR or submit a fresh one.

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.

demos/alert-to-slack-with-logic-app -> InvalidTemplate

2 participants