HI, deploying the slack logic app : https://github.com/Azure/azure-quickstart-templates/tree/master/201-alert-to-slack-with-logic-app, returns an error trying to call the webhook URI (manual and via script) :
Reason
Code
InvalidTemplate
Message
Unable to process template language expressions in action 'Http' inputs at line '1' and column '855': 'The template language expression 'triggerBody()['context']['portalLink']' cannot be evaluated because property 'context' doesn't exist, available properties are 'WorkspaceId, AlertRuleName, SearchQuery, AlertThresholdOperator, AlertThresholdValue, SearchIntervalStartTimeUtc, SearchIntervalEndtimeUtc, ResultCount, SearchIntervalInSeconds, LinkToResults, Description'. Please see https://aka.ms/logicexpressions for usage details.'.
I am getting this same error right now - what is the solution to this?
After struggling with this for some time, it looks like the documented payload schema for the webhook is just wrong. Changed the message that it was sending to slack to just send the whole "Body" of the incomming request, then pasted that back into the 'use sample payload to generate schema' box in the first step, and that works better. Here's the schema it generated:
{
"properties": {
"data": {
"properties": {
"context": {
"properties": {
"activityLog": {
"properties": {
"authorization": {
"properties": {
"action": {
"type": "string"
},
"scope": {
"type": "string"
}
},
"type": "object"
},
"caller": {
"type": "string"
},
"channels": {
"type": "string"
},
"claims": {
"type": "string"
},
"correlationId": {
"type": "string"
},
"description": {
"type": "string"
},
"eventDataId": {
"type": "string"
},
"eventSource": {
"type": "string"
},
"eventTimestamp": {
"type": "string"
},
"level": {
"type": "string"
},
"operationId": {
"type": "string"
},
"operationName": {
"type": "string"
},
"resourceGroupName": {
"type": "string"
},
"resourceId": {
"type": "string"
},
"resourceProviderName": {
"type": "string"
},
"resourceType": {
"type": "string"
},
"status": {
"type": "string"
},
"subStatus": {
"type": "string"
},
"submissionTimestamp": {
"type": "string"
},
"subscriptionId": {
"type": "string"
}
},
"type": "object"
}
},
"type": "object"
},
"properties": {
"properties": {},
"type": "object"
},
"status": {
"type": "string"
}
},
"type": "object"
},
"schemaId": {
"type": "string"
}
},
"type": "object"
}
Why is this closed? I'm having the same problem as @guya1976 posted originally.
Guys, any updates from this? I am not able to get any content from the logic app at all.
@bogdanalov see #3319 for a more detailed explanation. In short, for the ones who end up here: this template only work for _classic_ alerts, not for the new log alerts.
You can get the schema for common from the json content@ https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-common-schema-definitions
This section contains the correct steps to get the correct schema for the incoming http request:
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/action-groups-logic-app#create-a-metric-alert
Most helpful comment
I am getting this same error right now - what is the solution to this?