az monitor sli
This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Manage Service Level Indicators (SLIs) in Azure Monitor.
Identity model: SLIs only support user-assigned managed identities (UAMIs). System-assigned identity is not supported by the service. A UAMI must be referenced in three places that the service keeps in sync:
- The ARM identity block (
identity.userAssignedIdentities). - Each destination AMW (
properties.destinationAmwAccounts[].identity). - Each signal source (
properties.sliProperties.{signals|goodSignals| totalSignals}.signalSources[].sourceAmwAccountManagedIdentity). The service rejects PUTs where these three sets disagree. To rotate a UAMI, update all three surfaces in a singleaz monitor sli updatecall so the PUT is atomic. Seeaz monitor sli update --helpfor worked rotation examples. Runaz monitor sli showfirst to confirm the actual indices and which signal slot (signalsfor window-based,goodSignals+totalSignalsfor request-based) is populated.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az monitor sli create |
Create an SLI resource. |
Core | Preview |
| az monitor sli delete |
Delete an SLI resource. |
Core | Preview |
| az monitor sli list |
List all SLI resources under a parent resource. |
Core | Preview |
| az monitor sli show |
Get an SLI resource. |
Core | Preview |
| az monitor sli update |
Update an SLI resource. |
Core | Preview |
az monitor sli create
Command group 'az monitor sli' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Create an SLI resource.
A user-assigned managed identity is required and must match the identity
referenced by each destination AMW account and each signal source. Complex
object arguments (--baseline-properties, --destination-amw-accounts,
--sli-properties) are easiest to pass via JSON files using the
@filename.json syntax.
az monitor sli create --mi-user-assigned --user-assigned
--service-group-name
--sli-name
[--acquire-policy-token]
[--amw-accounts --destination-amw-accounts]
[--baseline-properties]
[--category {Availability, Latency}]
[--change-reference]
[--description]
[--enable-alert {0, 1, f, false, n, no, t, true, y, yes}]
[--evaluation-type {RequestBased, WindowBased}]
[--sli-properties]
Examples
Create a window-based availability SLI from JSON payload files.
az monitor sli create --service-group-name MyServiceGroup --sli-name MySli --user-assigned <uami-arm-id> --category Availability --evaluation-type WindowBased --description "API availability SLI" --baseline-properties @baseline.json --destination-amw-accounts @destinations.json --sli-properties @sli-properties.json
Required Parameters
Set the user managed identities. At least one user-assigned managed identity is required; system-assigned identity is not supported by this service. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Identity Arguments |
The name of the service group.
Name of the SLI that is given by the user.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Destination AMW accounts. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Defines the SLO baseline associated with the SLI. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Specifies the category of the SLI, used to classify signals such as Availability and Latency.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | Availability, Latency |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
A user-provided description of the SLI, with a maximum length of 1000 characters.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
A flag to determine whether alert is enabled.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Determines how the SLI is evaluated—either based on request counts or time windows.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | RequestBased, WindowBased |
Defines the SLI properties associated with the SLI. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties 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 monitor sli delete
Command group 'az monitor sli' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Delete an SLI resource.
az monitor sli delete --service-group-name
--sli-name
[--acquire-policy-token]
[--change-reference]
[--yes]
Examples
Delete an SLI without confirmation prompt.
az monitor sli delete --service-group-name MyServiceGroup --sli-name MySli --yes
Required Parameters
The name of the service group.
Name of the SLI that is given by the user.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
Do not prompt for confirmation.
| Property | Value |
|---|---|
| Default value: | False |
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 monitor sli list
Command group 'az monitor sli' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
List all SLI resources under a parent resource.
az monitor sli list --service-group-name
[--max-items]
[--next-token]
Examples
List all SLIs in a service group.
az monitor sli list --service-group-name MyServiceGroup
Required Parameters
The name of the service group.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.
| Property | Value |
|---|---|
| Parameter group: | Pagination Arguments |
Token to specify where to start paginating. This is the token value from a previously truncated response.
| Property | Value |
|---|---|
| Parameter group: | Pagination 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 monitor sli show
Command group 'az monitor sli' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Get an SLI resource.
az monitor sli show --service-group-name
--sli-name
Examples
Show an SLI by name.
az monitor sli show --service-group-name MyServiceGroup --sli-name MySli
Required Parameters
The name of the service group.
Name of the SLI that is given by the user.
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 monitor sli update
Command group 'az monitor sli' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Update an SLI resource.
Managed-identity changes must be applied to all three surfaces in a single PUT, because the service validates set-equality across them:
identity.userAssignedIdentities(top-level ARM identity dictionary).properties.destinationAmwAccounts[].identity.properties.sliProperties.{signals|goodSignals|totalSignals}.signalSources[].sourceAmwAccountManagedIdentity. Window-based SLIs populate thesignalsslot; request-based SLIs populategoodSignalsandtotalSignals. Runaz monitor sli showfirst to confirm the destination/signal-source indices and which slot is in use. The examples below assume the window-basedsignalsslot with one destination AMW and one signal source. Note: UAMI ARM IDs contain.(for exampleMicrosoft.ManagedIdentity), so they cannot be addressed as path segments by--set/--remove(azure-cli splits the path on.). To changeidentity.userAssignedIdentities, replace the whole map by passing a JSON value rooted atidentity.userAssignedIdentities.
az monitor sli update --service-group-name
--sli-name
[--acquire-policy-token]
[--add]
[--amw-accounts --destination-amw-accounts]
[--baseline-properties]
[--category {Availability, Latency}]
[--change-reference]
[--description]
[--enable-alert {0, 1, f, false, n, no, t, true, y, yes}]
[--evaluation-type {RequestBased, WindowBased}]
[--force-string {0, 1, f, false, n, no, t, true, y, yes}]
[--remove]
[--set]
[--sli-properties]
Examples
Update the description.
az monitor sli update --service-group-name MyServiceGroup --sli-name MySli --set properties.description="Updated API availability SLI"
Rotate the source-AMW managed identity (signal source 0) to a new UAMI.
az monitor sli update --service-group-name MyServiceGroup --sli-name MySli --set 'identity.userAssignedIdentities={"<new-source-uami-arm-id>":{}}' --set 'properties.sliProperties.signals.signalSources[0].sourceAmwAccountManagedIdentity=<new-source-uami-arm-id>'
Rotate the destination-AMW managed identity (destination 0) to a new UAMI.
az monitor sli update --service-group-name MyServiceGroup --sli-name MySli --set 'identity.userAssignedIdentities={"<new-destination-uami-arm-id>":{}}' --set 'properties.destinationAmwAccounts[0].identity=<new-destination-uami-arm-id>'
Rotate the source-AMW and destination-AMW managed identities together in a single update (single UAMI used for both).
az monitor sli update --service-group-name MyServiceGroup --sli-name MySli --set 'identity.userAssignedIdentities={"<new-uami-arm-id>":{}}' --set 'properties.destinationAmwAccounts[0].identity=<new-uami-arm-id>' --set 'properties.sliProperties.signals.signalSources[0].sourceAmwAccountManagedIdentity=<new-uami-arm-id>'
Required Parameters
The name of the service group.
Name of the SLI that is given by the user.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Acquiring an Azure Policy token automatically for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
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 |
Destination AMW accounts. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Defines the SLO baseline associated with the SLI. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
Specifies the category of the SLI, used to classify signals such as Availability and Latency.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | Availability, Latency |
The related change reference ID for this resource operation.
| Property | Value |
|---|---|
| Parameter group: | Global Policy Arguments |
A user-provided description of the SLI, with a maximum length of 1000 characters.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
A flag to determine whether alert is enabled.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Determines how the SLI is evaluated—either based on request counts or time windows.
| Property | Value |
|---|---|
| Parameter group: | Properties Arguments |
| Accepted values: | RequestBased, WindowBased |
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 |
Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.
| Property | Value |
|---|---|
| Parameter group: | Generic Update 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 |
Defines the SLI properties associated with the SLI. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
| Property | Value |
|---|---|
| Parameter group: | Properties 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 |