Azure预算警报架构模板

时间:2019-05-30 05:50:40

标签: azure azure-functions

我正在设置一些Azure预算警报,以调用Logic App Webhook来执行操作。

在预算中,我指定了警报条件,以预算的25%,50%和75%触发行动小组。该操作组具有使用通用警报架构调用Logic App Webhook的操作。

我有一个simple alert payload设置的“收到HTTP请求时”逻辑应用,并有一个处理请求的步骤。

在此处理步骤中,我想访问触发警报的预算详细信息(预算名称,预算百分比等),但示例架构不包含该信息:

{
    "properties": {
        "data": {
            "properties": {
                "alertContext": {
                    "properties": {
                        "condition": {
                            "properties": {
                                "allOf": {
                                    "items": {
                                        "properties": {
                                            "dimensions": {
                                                "items": {
                                                    "properties": {
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "value": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "name",
                                                        "value"
                                                    ],
                                                    "type": "object"
                                                },
                                                "type": "array"
                                            },
                                            "metricName": {
                                                "type": "string"
                                            },
                                            "metricNamespace": {
                                                "type": "string"
                                            },
                                            "metricValue": {
                                                "type": "number"
                                            },
                                            "operator": {
                                                "type": "string"
                                            },
                                            "threshold": {
                                                "type": "string"
                                            },
                                            "timeAggregation": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "metricName",
                                            "metricNamespace",
                                            "operator",
                                            "threshold",
                                            "timeAggregation",
                                            "dimensions",
                                            "metricValue"
                                        ],
                                        "type": "object"
                                    },
                                    "type": "array"
                                },
                                "windowSize": {
                                    "type": "string"
                                }
                            },
                            "type": "object"
                        },
                        "conditionType": {
                            "type": "string"
                        },
                        "properties": {}
                    },
                    "type": "object"
                },
                "essentials": {
                    "properties": {
                        "alertContextVersion": {
                            "type": "string"
                        },
                        "alertId": {
                            "type": "string"
                        },
                        "alertRule": {
                            "type": "string"
                        },
                        "alertTargetIDs": {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        },
                        "description": {
                            "type": "string"
                        },
                        "essentialsVersion": {
                            "type": "string"
                        },
                        "firedDateTime": {
                            "type": "string"
                        },
                        "monitorCondition": {
                            "type": "string"
                        },
                        "monitoringService": {
                            "type": "string"
                        },
                        "originAlertId": {
                            "type": "string"
                        },
                        "resolvedDateTime": {
                            "type": "string"
                        },
                        "severity": {
                            "type": "string"
                        },
                        "signalType": {
                            "type": "string"
                        }
                    },
                    "type": "object"
                }
            },
            "type": "object"
        },
        "schemaId": {
            "type": "string"
        }
    },
    "type": "object"
}

在某个地方是否有一个架构模板,其中包含预算警报的所有可能字段?这样我的Logic应用程序就可以在后续步骤中将那些“预算”字段用作动态内容。

谢谢

1 个答案:

答案 0 :(得分:0)

我创建了一个逻辑应用程序,将输入json放入Blob存储中。在“预算”警报操作组中将此逻辑应用添加为Webhook。

我收到了以下消息。看起来像是预算提醒的模式。

{
    "schemaId": "AIP Budget Notification",
    "data": {
        "SubscriptionName": "",
        "SubscriptionId": "",
        "EnrollmentNumber": "",
        "DepartmentName": "",
        "AccountName": "",
        "BillingAccountId": "",
        "BillingProfileId": "",
        "InvoiceSectionId": "",
        "ResourceGroup": "",
        "SpendingAmount": "",
        "BudgetStartDate": "",
        "Budget": "",
        "Unit": "",
        "BudgetCreator": "",
        "BudgetName": "",
        "BudgetType": "",
        "NotificationThresholdAmount": ""
    }
}

看起来像Microsoft在其文档中提到了此架构,但略有隐藏(请在下面的文章中查找json)

https://docs.microsoft.com/en-us/azure/billing/billing-cost-management-budget-scenario#create-an-azure-logic-app-for-orchestration