Share via


az load test

Note

This reference is part of the load extension for the Azure CLI (version 2.41.0 or higher). The extension will automatically install the first time you run an az load test command. Learn more about extensions.

This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Command group to manage load tests.

Command group to manage load test with create, update, delete, list, etc.

Commands

Name Description Type Status
az load test app-component

Command group to manage app components.

Extension Preview
az load test app-component add

Add an app component to a test.

Extension Preview
az load test app-component list

List all app components for a test.

Extension Preview
az load test app-component remove

Remove the given app component from a test.

Extension Preview
az load test compare-to-baseline

Compare the sampler statistics from recent test runs with those of the baseline test run.

Extension Preview
az load test convert-to-jmx

Convert a URL type test to JMX test.

Extension Preview
az load test create

Create a new load test.

Extension Preview
az load test delete

Delete an existing load test.

Extension Preview
az load test download-files

Download files of an existing load test.

Extension Preview
az load test file

Command group for operations on test files.

Extension Preview
az load test file delete

Delete a file from test.

Extension Preview
az load test file download

Download a file from a test.

Extension Preview
az load test file list

List all files in a test.

Extension Preview
az load test file upload

Upload a file to a test.

Extension Preview
az load test list

List all tests in the given load test resource.

Extension Preview
az load test server-metric

Command group to manage server metrics.

Extension Preview
az load test server-metric add

Add a server-metric to a test.

Extension Preview
az load test server-metric list

List all server-metrics for a test.

Extension Preview
az load test server-metric remove

Remove the given server-metric from the test.

Extension Preview
az load test set-baseline

Set a test run as the baseline for comparison with other runs in the test.

Extension Preview
az load test show

Show details of test.

Extension Preview
az load test update

Update an existing load test.

Extension Preview

az load test compare-to-baseline

Preview

Command group 'load test' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Compare the sampler statistics from recent test runs with those of the baseline test run.

az load test compare-to-baseline --load-test-resource
                                 --test-id
                                 [--aggregation {MAX, MEAN, MEDIAN, MIN, P75, P90, P95, P96, P98, P99, P999, P9999}]
                                 [--resource-group]

Examples

Compare recent test runs to baseline.

az load test compare-to-baseline --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id -o table

Compare recent test runs to baseline with specific aggregation.

az load test compare-to-baseline --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id --aggregation P95 -o table

Required Parameters

--load-test-resource --name -n

Name or ARM resource ID of the Load Testing resource.

--test-id -t

Test ID of the load test.

Optional Parameters

--aggregation

Specify the aggregation method for response time.

Accepted values: MAX, MEAN, MEDIAN, MIN, P75, P90, P95, P96, P98, P99, P999, P9999
Default value: MEAN
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az load test convert-to-jmx

Preview

Command group 'load test' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Convert a URL type test to JMX test.

az load test convert-to-jmx --load-test-resource
                            --test-id
                            [--resource-group]
                            [--yes]

Examples

Convert to JMX test.

az load test convert-to-jmx --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id

Required Parameters

--load-test-resource --name -n

Name or ARM resource ID of the Load Testing resource.

--test-id -t

Test ID of the load test.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az load test create

Preview

Command group 'load test' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a new load test.

az load test create --load-test-resource
                    --test-id
                    [--autostop]
                    [--autostop-error-rate]
                    [--autostop-time-window]
                    [--certificate]
                    [--description]
                    [--disable-public-ip]
                    [--display-name]
                    [--engine-instances]
                    [--env]
                    [--keyvault-reference-id]
                    [--load-test-config-file]
                    [--no-wait]
                    [--regionwise-engines]
                    [--resource-group]
                    [--secret]
                    [--split-csv]
                    [--subnet-id]
                    [--test-plan]
                    [--test-type {JMX, URL}]

Examples

Create a test with load test config file.

az load test create --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-test-id --load-test-config-file ~/resources/sample-config.yaml

Create a test with arguments.

az load test create --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --display-name "Sample Name" --description "Test description" --test-plan sample-jmx.jmx --engine-instances 1 --env rps=2 count=1

Create a test with load test config file and override engine-instance and env using arguments and don't wait for file upload.

az load test create --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-test-id --load-test-config-file ~/resources/sample-config.yaml --engine-instances 1 --env rps=2 count=1 --no-wait

Create a test with secrets and environment variables.

az load test create --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --display-name "Sample Name" --description "Test description" --test-plan sample-jmx.jmx --secret secret_name1=secret_uri1 secret_name2=secret_uri2 --env rps=2 count=1

Create a test with secrets using user assigned Managed Identity to access the Key Vault.

az load test create --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --display-name "Sample Name" --secret secret_name1=secret_uri1 secret_name2=secret_uri2 --keyvault-reference-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-rg/providers/microsoft.managedidentity/userassignedidentities/sample-mi"

Create a test for a private endpoint in a Virtual Network with split CSV option enabled.

az load test create --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --display-name "Sample Name" --subnet-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/sample-rg/providers/Microsoft.Network/virtualNetworks/SampleVMVNET/subnets/SampleVMSubnet" --split-csv true

Create a test with custom defined autostop criteria or enable / disable autostop for a test.

az load test create --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --display-name "Sample Name" --autostop-error-rate 80.5 --autostop-time-window 120
az load test create --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --display-name "Sample Name" --autostop disable
az load test create --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --display-name "Sample Name" --autostop enable

Create a test with a multi-region load configuration using region names in the format accepted by Azure Resource Manager (ARM). Ensure the specified regions are supported by Azure Load Testing. Multi-region load tests are restricted to public endpoints only.

az load test create --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --engine-instances 3 --regionwise-engines eastus=1 westus2=1 germanywestcentral=1 --test-plan sample-jmx.jmx

Create an advanced URL test with multiple HTTP requests using a JSON file.

az load test create --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --test-plan ~/resources/sample-url-requests.json --test-type URL

Required Parameters

--load-test-resource --name -n

Name or ARM resource ID of the Load Testing resource.

--test-id -t

Test ID of the load test.

Optional Parameters

--autostop

Whether auto-stop should be enabled or disabled. Allowed values are enable/disable.

--autostop-error-rate

Threshold percentage of errors on which test run should be automatically stopped. Allowed values are in range of [0.0,100.0].

--autostop-time-window

Time window during which the error percentage should be evaluated in seconds.

--certificate

A single certificate in 'key[=value]' format. The certificate should be stored in Azure Key Vault in PFX format, and the certificate identifier should be provided as the value.

--description

Description of the load test.

--disable-public-ip

Disable the deployment of a public IP address, load balancer, and network security group while testing a private endpoint.

--display-name

Display name of the load test.

--engine-instances

Number of engine instances on which the test should run.

--env

Space-separated environment variables: key[=value] [key[=value] ...].

--keyvault-reference-id

The identity that will be used to access the key vault.

--load-test-config-file
--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--regionwise-engines

Specify the engine count for each region in the format: region1=engineCount1 region2=engineCount2 .... Use region names in the format accepted by Azure Resource Manager (ARM). Ensure the regions are supported by Azure Load Testing. Multi-region load tests can only target public endpoints.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--secret

Space-separated secrets: key[=value] [key[=value] ...]. Secrets should be stored in Azure Key Vault, and the secret identifier should be provided as the value.

--split-csv

Split CSV files evenly among engine instances.

--subnet-id

Resource ID of the subnet to use for private load test.

--test-plan

Reference to the test plan file. If testType: JMX: path to the JMeter script. If testType: URL: path to the requests JSON file.

--test-type

Type of the load test.

Accepted values: JMX, URL
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az load test delete

Preview

Command group 'load test' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete an existing load test.

az load test delete --load-test-resource
                    --test-id
                    [--resource-group]
                    [--yes]

Examples

Delete a load test.

az load test delete --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id

Required Parameters

--load-test-resource --name -n

Name or ARM resource ID of the Load Testing resource.

--test-id -t

Test ID of the load test.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az load test download-files

Preview

Command group 'load test' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Download files of an existing load test.

az load test download-files --load-test-resource
                            --path
                            --test-id
                            [--force]
                            [--resource-group]

Examples

Download all files of a test. The directory should already exist.

az load test download-files --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --path ~/downloads

Download all files of a test by creating the directory if it does not exist.

az load test download-files --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg --path "~/downloads/new folder" --force

Required Parameters

--load-test-resource --name -n

Name or ARM resource ID of the Load Testing resource.

--path

Path of the directory to download files.

--test-id -t

Test ID of the load test.

Optional Parameters

--force

Force run the command. This will create the directory to download files if it does not exist.

Default value: False
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az load test list

Preview

Command group 'load test' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List all tests in the given load test resource.

az load test list --load-test-resource
                  [--resource-group]

Examples

List all load tests in a resource.

az load test list --load-test-resource sample-alt-resource --resource-group sample-rg

Required Parameters

--load-test-resource --name -n

Name or ARM resource ID of the Load Testing resource.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az load test set-baseline

Preview

Command group 'load test' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Set a test run as the baseline for comparison with other runs in the test.

az load test set-baseline --load-test-resource
                          --test-id
                          --test-run-id
                          [--resource-group]

Examples

Set baseline test run.

az load test set-baseline --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id --test-run-id sample-associated-test-run-id

Required Parameters

--load-test-resource --name -n

Name or ARM resource ID of the Load Testing resource.

--test-id -t

Test ID of the load test.

--test-run-id -r

Test run ID of the load test run.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az load test show

Preview

Command group 'load test' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Show details of test.

az load test show --load-test-resource
                  --test-id
                  [--resource-group]

Examples

Get the details of a load test.

az load test show --test-id sample-test-id --load-test-resource sample-alt-resource --resource-group sample-rg

Required Parameters

--load-test-resource --name -n

Name or ARM resource ID of the Load Testing resource.

--test-id -t

Test ID of the load test.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

az load test update

Preview

Command group 'load test' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update an existing load test.

az load test update --load-test-resource
                    --test-id
                    [--autostop]
                    [--autostop-error-rate]
                    [--autostop-time-window]
                    [--certificate]
                    [--description]
                    [--disable-public-ip]
                    [--display-name]
                    [--engine-instances]
                    [--env]
                    [--keyvault-reference-id]
                    [--load-test-config-file]
                    [--no-wait]
                    [--regionwise-engines]
                    [--resource-group]
                    [--secret]
                    [--split-csv]
                    [--subnet-id]
                    [--test-plan]

Examples

Update a test with load test config file and don't wait for file upload.

az load test update --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id --load-test-config-file ~/resources/sample-config.yaml --no-wait

Update the display name and description for a test.

az load test update --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id --description "Test description" --display-name "Sample Name"

Update a test with load test config file and override parameters using arguments.

az load test update --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id --load-test-config-file ~/resources/sample-config.yaml --engine-instances 1 --env name=value name=value

Remove the secrets from a test.

az load test update --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id --secret secret_name1=""

Update the Key Vault reference identity to system assigned Managed Identity.

az load test update --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id --keyvault-reference-id null

Update autostop criteria.

az load test update --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id --autostop-error-rate 90 --autostop-time-window 180

Update multi-region load configuration.

az load test update --load-test-resource sample-alt-resource --resource-group sample-rg --test-id sample-existing-test-id --engine-instances 5 --regionwise-engines eastus=2 westus2=1 eastasia=2

Required Parameters

--load-test-resource --name -n

Name or ARM resource ID of the Load Testing resource.

--test-id -t

Test ID of the load test.

Optional Parameters

--autostop

Whether auto-stop should be enabled or disabled. Allowed values are enable/disable.

--autostop-error-rate

Threshold percentage of errors on which test run should be automatically stopped. Allowed values are in range of [0.0,100.0].

--autostop-time-window

Time window during which the error percentage should be evaluated in seconds.

--certificate

A single certificate in 'key[=value]' format. The certificate should be stored in Azure Key Vault in PFX format, and the certificate identifier should be provided as the value.Use "" to clear existing certificate.

--description

Description of the load test.

--disable-public-ip

Disable the deployment of a public IP address, load balancer, and network security group while testing a private endpoint.

--display-name

Display name of the load test.

--engine-instances

Number of engine instances on which the test should run.

--env

Space-separated environment variables: key[=value] [key[=value] ...]. Use "" to clear existing environment variables.

--keyvault-reference-id

The identity that will be used to access the key vault. Provide null or None to use the system assigned identity of the load test resource.

--load-test-config-file
--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--regionwise-engines

Specify the engine count for each region in the format: region1=engineCount1 region2=engineCount2 .... Use region names in the format accepted by Azure Resource Manager (ARM). Ensure the regions are supported by Azure Load Testing. Multi-region load tests can only target public endpoints.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--secret

Space-separated secrets: key[=value] [key[=value] ...]. Secrets should be stored in Azure Key Vault, and the secret identifier should be provided as the value.Use "" to clear existing secrets.

--split-csv

Split CSV files evenly among engine instances.

--subnet-id

Resource ID of the subnet to use for private load test.

--test-plan

Reference to the test plan file. If testType: JMX: path to the JMeter script. If testType: URL: path to the requests JSON file.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.