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:

  1. The ARM identity block (identity.userAssignedIdentities).
  2. Each destination AMW (properties.destinationAmwAccounts[].identity).
  3. 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 single az monitor sli update call so the PUT is atomic. See az monitor sli update --help for worked rotation examples. Run az monitor sli show first to confirm the actual indices and which signal slot (signals for window-based, goodSignals + totalSignals for 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

Preview

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

--mi-user-assigned --user-assigned

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
--service-group-name

The name of the service group.

--sli-name

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.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--amw-accounts --destination-amw-accounts

Destination AMW accounts. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Property Value
Parameter group: Properties Arguments
--baseline-properties

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
--category

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
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--description

A user-provided description of the SLI, with a maximum length of 1000 characters.

Property Value
Parameter group: Properties Arguments
--enable-alert

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
--evaluation-type

Determines how the SLI is evaluated—either based on request counts or time windows.

Property Value
Parameter group: Properties Arguments
Accepted values: RequestBased, WindowBased
--sli-properties

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
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az monitor sli delete

Preview

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

--service-group-name

The name of the service group.

--sli-name

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.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--yes -y

Do not prompt for confirmation.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az monitor sli list

Preview

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

--service-group-name

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.

--max-items

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
--next-token

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
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az monitor sli show

Preview

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

--service-group-name

The name of the service group.

--sli-name

Name of the SLI that is given by the user.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az monitor sli update

Preview

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:

  1. identity.userAssignedIdentities (top-level ARM identity dictionary).
  2. properties.destinationAmwAccounts[].identity.
  3. properties.sliProperties.{signals|goodSignals|totalSignals}.signalSources[].sourceAmwAccountManagedIdentity. Window-based SLIs populate the signals slot; request-based SLIs populate goodSignals and totalSignals. Run az monitor sli show first to confirm the destination/signal-source indices and which slot is in use. The examples below assume the window-based signals slot with one destination AMW and one signal source. Note: UAMI ARM IDs contain . (for example Microsoft.ManagedIdentity), so they cannot be addressed as path segments by --set/--remove (azure-cli splits the path on .). To change identity.userAssignedIdentities, replace the whole map by passing a JSON value rooted at identity.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

--service-group-name

The name of the service group.

--sli-name

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.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--add

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
--amw-accounts --destination-amw-accounts

Destination AMW accounts. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

Property Value
Parameter group: Properties Arguments
--baseline-properties

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
--category

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
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--description

A user-provided description of the SLI, with a maximum length of 1000 characters.

Property Value
Parameter group: Properties Arguments
--enable-alert

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
--evaluation-type

Determines how the SLI is evaluated—either based on request counts or time windows.

Property Value
Parameter group: Properties Arguments
Accepted values: RequestBased, WindowBased
--force-string

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

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Property Value
Parameter group: Generic Update Arguments
--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Property Value
Parameter group: Generic Update Arguments
--sli-properties

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
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False