Azure / Azure/azure-quickstart-templates
201-alert-to-slack-with-logic-app
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
The [201-alert-to-slack-with-logic-app](https://github.com/Azure/azure-quickstart-templates/tree/master/201-alert-to-slack-with-logic-app) template appears to be not working ( issue #2514 seems to be the original report of this issue but is closed for some reason )
## The problem
After deploying the template and configuring an alert to use the web hook, it fails with:
> InvalidTemplate. Unable to process template language expressions in action 'Post_Message' inputs at line '1' and column '1412': 'The template language expression 'triggerBody()['context']['name']' cannot be evaluated because property 'context' doesn't exist, available properties are 'schemaId, data'. Please see https://aka.ms/logicexpressions for usage details.'.
As noted in #2514 I was eventually able to make it work by updating the schema to match what the azure alert is actually sending (it seems like "status", "context", and "properties" are actually inside a "data" node, rather than top level as documented in [Configure a webhook on an Azure metric alert](https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/insights-webhooks-alerts))
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the 201-alert-to-slack-with-logic-app template and inspect its webhook schema and the Post_Message action. Compare the declared payload shape with the alert body described in this issue and the linked #2514 report; done means a deployed template can process an alert and post the expected message to Slack without the InvalidTemplate error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100