az alerts-management prometheus-rule-group
Note
This reference is part of the alertsmanagement extension for the Azure CLI (version 2.45.0 or higher). The extension will automatically install the first time you run an az alerts-management prometheus-rule-group command. Learn more about extensions.
Manage Prometheus Rule Group.
Commands
Name | Description | Type | Status |
---|---|---|---|
az alerts-management prometheus-rule-group create |
Create a Prometheus rule group definition. |
Extension | GA |
az alerts-management prometheus-rule-group delete |
Delete a Prometheus rule group definition. |
Extension | GA |
az alerts-management prometheus-rule-group list |
List Prometheus all rule group definitions in a subscription. |
Extension | GA |
az alerts-management prometheus-rule-group show |
Get a Prometheus rule group definition. |
Extension | GA |
az alerts-management prometheus-rule-group update |
Update a Prometheus rule group definition. |
Extension | GA |
az alerts-management prometheus-rule-group create
Create a Prometheus rule group definition.
az alerts-management prometheus-rule-group create --name
--resource-group
--rules
--scopes
[--cluster-name]
[--description]
[--enabled {0, 1, f, false, n, no, t, true, y, yes}]
[--interval]
[--location]
[--tags]
Examples
Create a Prometheus rule group definition.
az alerts-management prometheus-rule-group create -n TestPrometheusRuleGroup -g TestResourceGroup -l westus --enabled --description "test" --interval PT10M --scopes "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/testrg/providers/microsoft.monitor/accounts/testaccount" --rules [{"record":"test","expression":"test","labels":{"team":"prod"}},{"alert":"Billing_Processing_Very_Slow","expression":"test","enabled":"true","severity":2,"for":"PT5M","labels":{"team":"prod"},"annotations":{"annotationName1":"annotationValue1"},"resolveConfiguration":{"autoResolved":"true","timeToResolve":"PT10M"},"actions":[{"actionGroupId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/microsoft.insights/actionGroups/test-action-group-name1","actionProperties":{"key11":"value11","key12":"value12"}},{"actionGroupId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testrg/providers/microsoft.insights/actionGroups/test-action-group-name2","actionProperties":{"key21":"value21","key22":"value22"}}]}]
Required Parameters
The name of the rule group.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Defines the rules in the Prometheus rule group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Target Azure Monitor workspaces resource ids. This api-version is currently limited to creating with one scope. This may change in future. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Optional Parameters
Apply rule to data from a specific cluster.
Rule group description.
Enable/disable rule group.
The interval in which to run the Prometheus rule group represented in ISO 8601 duration format. Should be between 1 and 15 minutes.
The geo-location where the resource lives When not specified, the location of the resource group will be used.
Resource tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az alerts-management prometheus-rule-group delete
Delete a Prometheus rule group definition.
az alerts-management prometheus-rule-group delete [--ids]
[--name]
[--resource-group]
[--subscription]
Examples
Delete a Prometheus rule group definition.
az alerts-management prometheus-rule-group delete -n TestPrometheusRuleGroup -g MyResourceGroup
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The name of the rule group.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az alerts-management prometheus-rule-group list
List Prometheus all rule group definitions in a subscription.
az alerts-management prometheus-rule-group list [--resource-group]
Examples
List a Prometheus rule group definition.
az alerts-management prometheus-rule-group list -g MyResourceGroup
Optional Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az alerts-management prometheus-rule-group show
Get a Prometheus rule group definition.
az alerts-management prometheus-rule-group show [--ids]
[--name]
[--resource-group]
[--subscription]
Examples
Show a Prometheus rule group definition.
az alerts-management prometheus-rule-group show -n TestPrometheusRuleGroup -g MyResourceGroup
Optional Parameters
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The name of the rule group.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az alerts-management prometheus-rule-group update
Update a Prometheus rule group definition.
az alerts-management prometheus-rule-group update [--add]
[--cluster-name]
[--description]
[--enabled {0, 1, f, false, n, no, t, true, y, yes}]
[--force-string {0, 1, f, false, n, no, t, true, y, yes}]
[--ids]
[--interval]
[--name]
[--remove]
[--resource-group]
[--rules]
[--scopes]
[--set]
[--subscription]
[--tags]
Examples
Update a Prometheus rule group definition.
az alerts-management prometheus-rule-group update -n TestPrometheusRuleGroup -g MyResourceGroup --tags key=value
Optional Parameters
Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>
.
Apply rule to data from a specific cluster.
Rule group description.
Enable/disable rule group.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
The interval in which to run the Prometheus rule group represented in ISO 8601 duration format. Should be between 1 and 15 minutes.
The name of the rule group.
Remove a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Defines the rules in the Prometheus rule group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Target Azure Monitor workspaces resource ids. This api-version is currently limited to creating with one scope. This may change in future. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Resource tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.