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.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
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.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Apply rule to data from a specific cluster.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Rule group description.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Enable/disable rule group.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
The interval in which to run the Prometheus rule group represented in ISO 8601 duration format. Should be between 1 and 15 minutes.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
The geo-location where the resource lives When not specified, the location of the resource group will be used.
Property | Value |
---|---|
Parameter group: | Parameters Arguments |
Resource tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Property | Value |
---|---|
Parameter group: | Parameters Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
Property | Value |
---|---|
Default value: | False |
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
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The name of the rule group.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
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
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
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.
Property | Value |
---|---|
Default value: | False |
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
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The name of the rule group.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
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
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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>
.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
Apply rule to data from a specific cluster.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Rule group description.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Enable/disable rule group.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
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.
Property | Value |
---|---|
Parameter group: | 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.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
The name of the rule group.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Remove a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Defines the rules in the Prometheus rule group. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
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.
Property | Value |
---|---|
Parameter group: | Properties Arguments |
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Resource tags. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Property | Value |
---|---|
Parameter group: | Parameters Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |