Oct 21 2020
05:48 AM
- last edited on
Apr 08 2022
10:39 AM
by
TechCommunityAP
Oct 21 2020
05:48 AM
- last edited on
Apr 08 2022
10:39 AM
by
TechCommunityAP
Hi,
Is it possible to include tags in the azure monitor alert (the tags configured on the resource on which the alert was triggerred, like "Environment:prod/test/qa")?
Ohad.
Nov 01 2020 11:59 PM
Hi Ohad,
Currently, if you want to enrich the alert with the resource tag, you will need to do it yourself, for example - using a Logic App action in the action group.
We are considering adding this functionality out-of-the-box later in 2021.
Thanks,
Ofir
Jun 07 2021 11:16 PM
I got an offline question about this, so updating for future readers who may run into that....
In Logic App, you can have an HTTP action. You can use it to call the following ARM API that returns the tags on an Azure resource:
Tags - Get At Scope - REST API (Azure Resource Management) | Microsoft Docs
Jul 28 2023 02:07 AM
Is there any update on Adding Asset Tags in Azure Monitor Alert (apart from using Logic App)?
- We have requirement to enrich the Alert with Asset Tags before sending it to any third-party tool for further action.
Jul 30 2023 12:36 AM
Hi @ravigupta1
We are working these days on planning our next developments, and this is part of our backlog. we will be happy to meet you and discuss on your requirements.
Can you contact me directly noga.lavi@microsoft.com ?
Thanks!
Feb 16 2024 05:28 AM
Mar 14 2024 01:06 AM
May 16 2024 09:43 AM
May 18 2024 07:47 AM
Yes, it is possible to include tags in Azure Monitor alerts by using Azure Logic Apps or Azure Functions to enrich the alert payload with the resource tags.
Here’s a step-by-step approach to accomplish this:
Create the Azure Monitor Alert:
Trigger a Logic App or Azure Function:
Retrieve Resource Tags:
For Logic Apps:
For Azure Functions:
Enrich the Alert Payload:
Example in a Logic App:
json
{
"actions": [
{
"call": {
"method": "GET",
"uri": "https://management.azure.com/{resourceId}?api-version=2021-04-01",
"headers": {
"Authorization": "Bearer {token}"
}
},
"extract": {
"path": "$.tags"
},
"compose": {
"inputs": {
"tags": "@body('HTTP')['tags']"
}
}
}
]
}
5. Notify or Act on the Enriched Alert:
By following these steps, you can include the tags configured on the resource in the Azure Monitor alert payload. This approach allows you to have more context about the resource when an alert is triggered.