إنشاء تنبيه قياسي في سجلات Azure Monitor

إشعار

نوصي باستخدام الوحدة النمطية Azure Az PowerShell للتفاعل مع Azure. للبدء، راجع تثبيت Azure PowerShell. لمعرفة كيفية الترحيل إلى الوحدة النمطية Az PowerShell، راجع ترحيل Azure PowerShell من AzureRM إلى Az.

يمكنك استخدام قدرات التنبيه القياسي على مجموعة محددة مسبقا من السجلات في سجلات Azure Monitor. يتم تحويل السجلات المراقبة، التي يمكن جمعها من Azure أو أجهزة الكمبيوتر المحلية، إلى مقاييس ثم مراقبتها بقواعد التنبيه القياسي، تماما مثل أي مقياس آخر.

تدعم مساحة عمل Log Analytics أنواع السجلات التالية:

تتضمن فوائد استخدام التنبيهات القياسية للسجلات عبر تنبيهات بحث السجل المستندة إلى الاستعلام في Azure ما يلي:

  • توفر التنبيهات القياسية إمكانية مراقبة في الوقت الفعلي تقريبا. وهي تتشعب البيانات من مصدر السجل لضمان هذه الإمكانية.
  • التنبيهات القياسية ذات حالة. يقوم بإعلامك مرة واحدة عند إطلاق تنبيه ومرة واحدة عند حل التنبيه. تنبيهات البحث في السجل عديمة الحالة وتستمر في الإطلاق في كل فاصل زمني إذا تم استيفاء شرط التنبيه.
  • توفر التنبيهات القياسية أبعادا متعددة. وهي تسمح بالتصفية إلى قيم معينة مثل أجهزة الكمبيوتر وأنواع نظام التشغيل دون الحاجة إلى تحديد استعلام معقد في Log Analytics.

إشعار

لا يظهر مقياس أو بعد معين إلا إذا كانت البيانات الخاصة به موجودة في الفترة المختارة. تتوفر هذه المقاييس للعملاء الذين لديهم مساحات عمل Log Analytics.

المقاييس والأبعاد المدعومة للسجلات

باستخدام تنبيهات القياس، يمكنك استخدام الأبعاد لتصفية المقياس إلى المستوى الصحيح. القائمة الكاملة للمقاييس المدعومة للسجلات تعادل قائمة مقاييس مساحة عمل Log Analytics.

إشعار

لعرض مقياس مدعوم مستخرج من مساحة عمل Log Analytics عبر مقاييس Azure Monitor، يجب إنشاء تنبيه قياسي للسجلات على هذا المقياس المحدد. ستظهر الأبعاد التي تختارها في التنبيه القياسي للسجلات للاستكشاف فقط عبر مقاييس Azure Monitor.

إنشاء تنبيه قياسي للسجلات

قبل معالجة بيانات القياس من السجلات الشائعة في Log Analytics، يتم نقلها إلى مقاييس Azure Monitor. يمكنك بعد ذلك الاستفادة من قدرات النظام الأساسي المتري بالإضافة إلى التنبيهات القياسية، بما في ذلك وجود تنبيهات بتردد منخفض لمدة دقيقة واحدة.

عملية إنشاء تنبيهات قياسية للسجلات هي شقين:

  1. إنشاء قاعدة لاستخراج المقاييس من السجلات المدعومة باستخدام واجهة برمجة تطبيقات قواعد الاستعلام المجدولة (scheduledQueryRules).
  2. إنشاء تنبيه قياسي للمقياس المستخرج من السجل (في الخطوة 1) ومساحة عمل Log Analytics كمورد مستهدف.

المتطلبات الأساسية

قبل إنشاء تنبيه قياسي للسجلات، تأكد من إعداد العناصر التالية وإتاحتها:

  • مساحة عمل Log Analytics: يجب أن يكون لديك مساحة عمل Log Analytics صالحة ونشطة. لمزيد من المعلومات، راجع إنشاء مساحة عمل Log Analytics.
  • عامل تم تكوينه لمساحة عمل Log Analytics: تحتاج إلى تكوين عامل لأجهزة Azure الظاهرية أو الأجهزة المحلية لإرسال البيانات إلى مساحة عمل Log Analytics. لمزيد من المعلومات، راجع نظرة عامة على عامل Azure Monitor.
  • حل Log Analytics المدعوم: يجب تكوين حل Log Analytics وإرسال البيانات إلى مساحة عمل Log Analytics. الحلول المدعومة هي عدادات الأداء لنظامي التشغيل Windows وLinux وسجلات رسالة كشف أخطاء الاتصال ل Agent Health وإدارة تحديث أتمتة Azure وبيانات الحدث.
  • السجلات التي تم تكوينها لحل Log Analytics: يجب أن يحتوي حل Log Analytics على السجلات والبيانات المطلوبة التي تتوافق مع المقاييس المدعومة لمساحات عمل Log Analytics الممكنة . على سبيل المثال، يجب تكوين عداد الذاكرة المتوفرة ٪ في حل عدادات الأداء أولا.

أساليب إنشاء تنبيه قياسي للسجلات

يمكنك إنشاء تنبيهات قياسية وإدارتها باستخدام مدخل Microsoft Azure وقوالب Azure Resource Manager وواجهة برمجة تطبيقات REST وAzure PowerShell وAzure CLI.

بعد إنشاء تنبيهات قياسية للسجلات لمساحة عمل محددة ل Log Analytics، يكون لها جميع خصائص ووظائف التنبيهات القياسية، بما في ذلك مخطط الحمولة وحدود الحصة النسبية القابلة للتطبيق وسعر الفوترة.

للحصول على تفاصيل ونماذج خطوة بخطوة، راجع إنشاء قاعدة تنبيه قياسي أو تحريرها. اتبع الإرشادات لإدارة التنبيهات القياسية ولاحظ الاعتبارات التالية:

  • يجب أن يكون هدف التنبيه القياسي مساحة عمل Log Analytics صالحة.

  • يجب أن تكون الإشارة المختارة لتنبيه قياسي لمساحة عمل Log Analytics محددة من النوع Metric.

  • يمكنك التصفية لشروط أو موارد معينة باستخدام عوامل تصفية الأبعاد، لأن مقاييس السجلات متعددة الأبعاد.

  • عند تكوين منطق الإشارة، يمكنك إنشاء تنبيه واحد لامتداد قيم متعددة للبعد (مثل الكمبيوتر).

  • عند إنشاء تنبيه قياسي للسجلات باستخدام مدخل Microsoft Azure، يتم إنشاء قاعدة مقابلة لتحويل بيانات السجل إلى مقياس عبر scheduledQueryRules تلقائيا في الخلفية، دون الحاجة إلى أي تدخل أو إجراء من قبل المستخدم.

    إذا كنت لا تستخدم مدخل Microsoft Azure لإنشاء تنبيه قياسي لمساحة عمل Log Analytics محددة، يجب أولا إنشاء قاعدة صريحة يدويا لتحويل بيانات السجل إلى مقياس باستخدام scheduledQueryRules.

قوالب Azure Resource Manager

لإنشاء تنبيه قياسي للسجلات، يمكنك استخدام نموذج قوالب Resource Manager التالية.

بالنسبة للتنبيهات القياسية للسجلات التي تم إنشاؤها من خلال وسائل أخرى غير مدخل Microsoft Azure، يمكنك استخدام نماذج القوالب هذه لإنشاء scheduledQueryRulesقاعدة تحويل مستندة إلى سجل إلى مقياس قبل إنشاء تنبيه قياسي. إذا لم تفعل ذلك، فلن تكون هناك بيانات للتنبيه القياسي في السجلات.

تنبيه قياسي للسجلات ذات العتبة الثابتة

في نموذج القالب التالي، يعتمد إنشاء تنبيه قياسي لحد ثابت على الإنشاء الناجح لقاعدة استخراج المقاييس من السجلات عبر scheduledQueryRules.

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "convertRuleName": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Name of the rule to convert a log to a metric"
            }
        },
        "convertRuleDescription": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Description for the log converted to a metric."
            }
        },
        "convertRuleRegion": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Name of the region used by the workspace."
            }
        },
        "convertRuleStatus": {
            "type": "string",
            "defaultValue": "true",
            "metadata": {
                "description": "Specifies whether the log conversion rule is enabled."
            }
        },
        "convertRuleMetric": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Name of the metric after extraction is done from logs."
            }
        },
        "alertName": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Name of the alert."
            }
        },
        "alertDescription": {
            "type": "string",
            "defaultValue": "This is a metric alert",
            "metadata": {
                "description": "Description of the alert."
            }
        },
        "alertSeverity": {
            "type": "int",
            "defaultValue": 3,
            "allowedValues": [
                0,
                1,
                2,
                3,
                4
            ],
            "metadata": {
                "description": "Severity of the alert {0,1,2,3,4}."
            }
        },
        "isEnabled": {
            "type": "bool",
            "defaultValue": true,
            "metadata": {
                "description": "Specifies whether the alert is enabled."
            }
        },
        "resourceId": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Full resource ID of the resource emitting the metric that will be used for the comparison. For example: /subscriptions/00000000-0000-0000-0000-0000-00000000/resourceGroups/ResourceGroupName/providers/Microsoft.OperationalInsights/workspaces/workspaceName"
            }
        },
        "metricName": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Name of the metric used in the comparison to activate the alert."
            }
        },
        "operator": {
            "type": "string",
            "defaultValue": "GreaterThan",
            "allowedValues": [
                "Equals",
                "NotEquals",
                "GreaterThan",
                "GreaterThanOrEqual",
                "LessThan",
                "LessThanOrEqual"
            ],
            "metadata": {
                "description": "Operator comparing the current value with the threshold value."
            }
        },
        "threshold": {
            "type": "string",
            "defaultValue": "0",
            "metadata": {
                "description": "The threshold value at which the alert is activated."
            }
        },
        "timeAggregation": {
            "type": "string",
            "defaultValue": "Average",
            "allowedValues": [
                "Average",
                "Minimum",
                "Maximum",
                "Total"
            ],
            "metadata": {
                "description": "How the data that's collected should be combined over time."
            }
        },
        "windowSize": {
            "type": "string",
            "defaultValue": "PT5M",
            "metadata": {
                "description": "Period of time used to monitor alert activity based on the threshold. Must be between five minutes and one day. ISO 8601 duration format."
            }
        },
        "evaluationFrequency": {
            "type": "string",
            "defaultValue": "PT1M",
            "metadata": {
                "description": "How often the metric alert is evaluated, represented in ISO 8601 duration format."
            }
        },
        "actionGroupId": {
            "type": "string",
            "defaultValue": "",
            "metadata": {
                "description": "The ID of the action group that's triggered when the alert is activated or deactivated."
            }
        }
    },
    "variables": {
        "convertRuleSourceWorkspace": {
            "SourceId": "/subscriptions/1234-56789-1234-567a/resourceGroups/resourceGroupName/providers/Microsoft.OperationalInsights/workspaces/workspaceName"
        }
    },
    "resources": [
        {
            "name": "[parameters('convertRuleName')]",
            "type": "Microsoft.Insights/scheduledQueryRules",
            "apiVersion": "2018-04-16",
            "location": "[parameters('convertRuleRegion')]",
            "properties": {
                "description": "[parameters('convertRuleDescription')]",
                "enabled": "[parameters('convertRuleStatus')]",
                "source": {
                    "dataSourceId": "[variables('convertRuleSourceWorkspace').SourceId]"
                },
                "action": {
                    "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction",
                    "criteria": [{
                            "metricName": "[parameters('convertRuleMetric')]",
                            "dimensions": []
                        }
                    ]
                }
            }
        },
        {
            "name": "[parameters('alertName')]",
            "type": "Microsoft.Insights/metricAlerts",
            "location": "global",
            "apiVersion": "2018-03-01",
            "tags": {},
            "dependsOn":["[resourceId('Microsoft.Insights/scheduledQueryRules',parameters('convertRuleName'))]"],
            "properties": {
                "description": "[parameters('alertDescription')]",
                "severity": "[parameters('alertSeverity')]",
                "enabled": "[parameters('isEnabled')]",
                "scopes": ["[parameters('resourceId')]"],
                "evaluationFrequency":"[parameters('evaluationFrequency')]",
                "windowSize": "[parameters('windowSize')]",
                "criteria": {
                    "odata.type": "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria",
                    "allOf": [
                        {
                            "name" : "1st criterion",
                            "metricName": "[parameters('metricName')]",
                            "dimensions":[],
                            "operator": "[parameters('operator')]",
                            "threshold" : "[parameters('threshold')]",
                            "timeAggregation": "[parameters('timeAggregation')]"
                        }
                    ]
                },
                "actions": [
                    {
                        "actionGroupId": "[parameters('actionGroupId')]"
                    }
                ]
            }
        }
    ]
}

إذا قمت بحفظ JSON السابق ك metricfromLogsAlertStatic.json، يمكنك إقترنه بملف JSON معلمة للإنشاء استنادا إلى قالب Resource Manager. فيما يلي نموذج لملف JSON للمعلمة:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "convertRuleName": {
            "value": "TestLogtoMetricRule" 
        },
        "convertRuleDescription": {
            "value": "Test rule to extract metrics from logs via template"
        },
        "convertRuleRegion": {
            "value": "West Central US"
        },
        "convertRuleStatus": {
            "value": "true"
        },
        "convertRuleMetric": {
            "value": "Average_% Idle Time"
        },
        "alertName": {
            "value": "TestMetricAlertonLog"
        },
        "alertDescription": {
            "value": "New multidimensional metric alert created via template"
        },
        "alertSeverity": {
            "value":3
        },
        "isEnabled": {
            "value": true
        },
        "resourceId": {
            "value": "/subscriptions/1234-56789-1234-567a/resourceGroups/myRG/providers/Microsoft.OperationalInsights/workspaces/workspaceName"
        },
        "metricName":{
            "value": "Average_% Idle Time"
        },
        "operator": {
            "value": "GreaterThan"
        },
        "threshold":{
            "value": "1"
        },
        "timeAggregation":{
            "value": "Average"
        },
        "actionGroupId": {
            "value": "/subscriptions/1234-56789-1234-567a/resourceGroups/myRG/providers/microsoft.insights/actionGroups/actionGroupName"
        }
    }
}

بافتراض حفظ ملف المعلمة السابق ك metricfromLogsAlertStatic.parameters.json، يمكنك إنشاء تنبيهات قياسية للسجلات باستخدام قالب Resource Manager للإنشاء في مدخل Microsoft Azure.

بدلا من ذلك، يمكنك استخدام أمر Azure PowerShell هذا:

New-AzResourceGroupDeployment -ResourceGroupName "myRG" -TemplateFile metricfromLogsAlertStatic.json TemplateParameterFile metricfromLogsAlertStatic.parameters.json

أو يمكنك نشر قالب Resource Manager باستخدام Azure CLI:

az deployment group create --resource-group myRG --template-file metricfromLogsAlertStatic.json --parameters @metricfromLogsAlertStatic.parameters.json

تنبيه قياسي للسجلات ذات الحدود الديناميكية

في نموذج القالب التالي، يعتمد إنشاء تنبيه قياسي للحدود الديناميكية على الإنشاء الناجح لقاعدة استخراج المقاييس من السجلات عبر scheduledQueryRules.

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "convertRuleName": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Name of the rule to convert a log to a metric."
            }
        },
        "convertRuleDescription": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Description for the log converted to a metric."
            }
        },
        "convertRuleRegion": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Name of the region used by the workspace."
            }
        },
        "convertRuleStatus": {
            "type": "string",
            "defaultValue": "true",
            "metadata": {
                "description": "Specifies whether the log conversion rule is enabled."
            }
        },
        "convertRuleMetric": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Name of the metric after extraction is done from logs."
            }
        },
        "alertName": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Name of the alert."
            }
        },
        "alertDescription": {
            "type": "string",
            "defaultValue": "This is a metric alert",
            "metadata": {
                "description": "Description of the alert."
            }
        },
        "alertSeverity": {
            "type": "int",
            "defaultValue": 3,
            "allowedValues": [
                0,
                1,
                2,
                3,
                4
            ],
            "metadata": {
                "description": "Severity of the alert {0,1,2,3,4}."
            }
        },
        "isEnabled": {
            "type": "bool",
            "defaultValue": true,
            "metadata": {
                "description": "Specifies whether the alert is enabled."
            }
        },
        "resourceId": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Full resource ID of the resource emitting the metric that will be used for the comparison. For example: /subscriptions/00000000-0000-0000-0000-0000-00000000/resourceGroups/ResourceGroupName/providers/Microsoft.OperationalInsights/workspaces/workspaceName"
            }
        },
        "metricName": {
            "type": "string",
            "minLength": 1,
            "metadata": {
                "description": "Name of the metric used in the comparison to activate the alert."
            }
        },
        "operator": {
            "type": "string",
            "defaultValue": "GreaterOrLessThan",
            "allowedValues": [
                "GreaterThan",
                "LessThan",
                "GreaterOrLessThan"
            ],
            "metadata": {
                "description": "Operator comparing the current value with the threshold value."
            }
        },
        "alertSensitivity": {
            "type": "string",
            "defaultValue": "Medium",
            "allowedValues": [
                "High",
                "Medium",
                "Low"
            ],
            "metadata": {
                "description": "Tunes how 'noisy' the alerts for dynamic thresholds will be. 'High' will result in more alerts. 'Low' will result in fewer alerts."
            }
        },
        "numberOfEvaluationPeriods": {
            "type": "string",
            "defaultValue": "4",
            "metadata": {
                "description": "The number of periods to check in the alert evaluation."
            }
        },
        "minFailingPeriodsToAlert": {
            "type": "string",
            "defaultValue": "3",
            "metadata": {
                "description": "The number of unhealthy periods to alert on (must be lower or equal to numberOfEvaluationPeriods)."
            }
        },
        "timeAggregation": {
            "type": "string",
            "defaultValue": "Average",
            "allowedValues": [
                "Average",
                "Minimum",
                "Maximum",
                "Total"
            ],
            "metadata": {
                "description": "How the data that's collected should be combined over time."
            }
        },
        "windowSize": {
            "type": "string",
            "defaultValue": "PT5M",
            "metadata": {
                "description": "Period of time used to monitor alert activity based on the threshold. Must be between five minutes and one day. ISO 8601 duration format."
            }
        },
        "evaluationFrequency": {
            "type": "string",
            "defaultValue": "PT1M",
            "metadata": {
                "description": "How often the metric alert is evaluated, represented in ISO 8601 duration format."
            }
        },
        "actionGroupId": {
            "type": "string",
            "defaultValue": "",
            "metadata": {
                "description": "The ID of the action group that's triggered when the alert is activated or deactivated."
            }
        }
    },
    "variables": {
        "convertRuleSourceWorkspace": {
            "SourceId": "/subscriptions/1234-56789-1234-567a/resourceGroups/resourceGroupName/providers/Microsoft.OperationalInsights/workspaces/workspaceName"
        }
    },
    "resources": [
        {
            "name": "[parameters('convertRuleName')]",
            "type": "Microsoft.Insights/scheduledQueryRules",
            "apiVersion": "2018-04-16",
            "location": "[parameters('convertRuleRegion')]",
            "properties": {
                "description": "[parameters('convertRuleDescription')]",
                "enabled": "[parameters('convertRuleStatus')]",
                "source": {
                    "dataSourceId": "[variables('convertRuleSourceWorkspace').SourceId]"
                },
                "action": {
                    "odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction",
                    "criteria": [{
                            "metricName": "[parameters('convertRuleMetric')]",
                            "dimensions": []
                        }
                    ]
                }
            }
        },
        {
            "name": "[parameters('alertName')]",
            "type": "Microsoft.Insights/metricAlerts",
            "location": "global",
            "apiVersion": "2018-03-01",
            "tags": {},
            "dependsOn":["[resourceId('Microsoft.Insights/scheduledQueryRules',parameters('convertRuleName'))]"],
            "properties": {
                "description": "[parameters('alertDescription')]",
                "severity": "[parameters('alertSeverity')]",
                "enabled": "[parameters('isEnabled')]",
                "scopes": ["[parameters('resourceId')]"],
                "evaluationFrequency":"[parameters('evaluationFrequency')]",
                "windowSize": "[parameters('windowSize')]",
                "criteria": {
                    "odata.type": "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria",
                    "allOf": [
                        {
                            "criterionType": "DynamicThresholdCriterion",
                            "name" : "1st criterion",
                            "metricName": "[parameters('metricName')]",
                            "dimensions":[],
                            "operator": "[parameters('operator')]",
                            "alertSensitivity": "[parameters('alertSensitivity')]",
                            "failingPeriods": {
                                "numberOfEvaluationPeriods": "[parameters('numberOfEvaluationPeriods')]",
                                "minFailingPeriodsToAlert": "[parameters('minFailingPeriodsToAlert')]"
                            },
                            "timeAggregation": "[parameters('timeAggregation')]"
                        }
                    ]
                },
                "actions": [
                    {
                        "actionGroupId": "[parameters('actionGroupId')]"
                    }
                ]
            }
        }
    ]
}

إذا قمت بحفظ JSON السابق ك metricfromLogsAlertDynamic.json، يمكنك إقترنه بملف JSON معلمة للإنشاء استنادا إلى قالب Resource Manager. فيما يلي نموذج لملف JSON للمعلمة:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "convertRuleName": {
            "value": "TestLogtoMetricRule"
        },
        "convertRuleDescription": {
            "value": "Test rule to extract metrics from logs via template"
        },
        "convertRuleRegion": {
            "value": "West Central US"
        },
        "convertRuleStatus": {
            "value": "true"
        },
        "convertRuleMetric": {
            "value": "Average_% Idle Time"
        },
        "alertName": {
            "value": "TestMetricAlertonLog"
        },
        "alertDescription": {
            "value": "New multidimensional metric alert created via template"
        },
        "alertSeverity": {
            "value":3
        },
        "isEnabled": {
            "value": true
        },
        "resourceId": {
            "value": "/subscriptions/1234-56789-1234-567a/resourceGroups/myRG/providers/Microsoft.OperationalInsights/workspaces/workspaceName"
        },
        "metricName":{
            "value": "Average_% Idle Time"
        },
        "operator": {
            "value": "GreaterOrLessThan"
          },
          "alertSensitivity": {
              "value": "Medium"
          },
          "numberOfEvaluationPeriods": {
              "value": "4"
          },
          "minFailingPeriodsToAlert": {
              "value": "3"
          },
        "timeAggregation":{
            "value": "Average"
        },
        "actionGroupId": {
            "value": "/subscriptions/1234-56789-1234-567a/resourceGroups/myRG/providers/microsoft.insights/actionGroups/actionGroupName"
        }
    }
}

بافتراض حفظ ملف المعلمة السابق ك metricfromLogsAlertDynamic.parameters.json، يمكنك إنشاء تنبيهات قياسية للسجلات باستخدام قالب Resource Manager للإنشاء في مدخل Microsoft Azure.

بدلا من ذلك، يمكنك استخدام أمر Azure PowerShell هذا:

New-AzResourceGroupDeployment -ResourceGroupName "myRG" -TemplateFile metricfromLogsAlertDynamic.json TemplateParameterFile metricfromLogsAlertDynamic.parameters.json

أو يمكنك نشر قالب Resource Manager باستخدام Azure CLI:

az deployment group create --resource-group myRG --template-file metricfromLogsAlertDynamic.json --parameters @metricfromLogsAlertDynamic.parameters.json