Azure / azure-cli

Azure Command-Line Interface
MIT License
3.92k stars 2.88k forks source link

Create, view, and manage log alerts #8663

Open ctaggart opened 5 years ago

ctaggart commented 5 years ago

Metric alerts can be managed with az monitor metrics alert:

az monitor metrics alert -h

Group
    az monitor metrics alert : Manage near-realtime metric alert rules.

Commands:
    create : Create a metric-based alert rule.
    delete : Delete a metrics-based alert rule.
    list   : List metric-based alert rules.
    show   : Show a metrics-based alert rule.
    update : Update a metric-based alert rule.

I want the same thing for log alerts.

Metric alerts has:

Create, view, and manage metric alerts using Azure Monitor https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-metric

Log alerts has:

Create, view, and manage log alerts using Azure Monitor https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-log

Log alerts do not have dedicated PowerShell or CLI commands currently

msvijayn commented 5 years ago

Thank you for reporting the issue. We already have PS cmdlets available for log alerts. Azure Monitor Alerts team is working on developing native Azure CLI command support for log alerts (scheduledQueryRules) and we'll revert back to you shortly, with details.

yonzhan commented 4 years ago

add to backlog.

petenorth commented 3 years ago

Would be really go to have this and hoping that it would print the resource id of a log alert that I need to import into terraform state! Guess I'll have to do a manual REST API call ...

JochemE commented 2 months ago

Azure Monitor Alerts team is working on developing native Azure CLI command support for log alerts (scheduledQueryRules) and we'll revert back to you shortly, with details.

I guess, the support in azure cli, is still work in-progress? https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-manage-alert-instances#manage-your-alerts-programmatically