az monitor app-insights web-test
Note
This reference is part of the application-insights extension for the Azure CLI (version 2.71.0 or higher). The extension will automatically install the first time you run an az monitor app-insights web-test command. Learn more about extensions.
Manage web test with application insights.
Commands
Name | Description | Type | Status |
---|---|---|---|
az monitor app-insights web-test create |
Create an Application Insights web test definition. |
Extension | GA |
az monitor app-insights web-test delete |
Delete an Application Insights web test. |
Extension | GA |
az monitor app-insights web-test list |
Get all Application Insights web tests defined for the specified component. And Get all Application Insights web tests defined within a specified resource group. And Get all Application Insights web test alerts definitions within a subscription. |
Extension | GA |
az monitor app-insights web-test show |
Get a specific Application Insights web test definition. |
Extension | GA |
az monitor app-insights web-test update |
Update an Application Insights web test definition. |
Extension | GA |
az monitor app-insights web-test create
Create an Application Insights web test definition.
az monitor app-insights web-test create --name --web-test-name
--resource-group
[--content-validation]
[--defined-web-test-name]
[--description]
[--enabled {false, true}]
[--expected-status-code]
[--follow-redirects {false, true}]
[--frequency]
[--headers]
[--http-verb]
[--ignore-status-code {false, true}]
[--kind {multistep, ping}]
[--location]
[--locations]
[--parse-requests {false, true}]
[--request-body]
[--request-url]
[--retry-enabled {false, true}]
[--ssl-check {false, true}]
[--ssl-lifetime-check]
[--synthetic-monitor-id]
[--tags]
[--timeout]
[--web-test]
[--web-test-kind {multistep, ping, standard}]
Examples
webTestCreate
az monitor app-insights web-test create --kind "ping" --location "South Central US" --web-test "<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\" ><Items><Request Method=\"GET\" Guid=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>" --description "Ping web test alert for mytestwebapp" --enabled true --frequency 900 --web-test-kind "ping" --locations Id="us-fl-mia-edge" --defined-web-test-name "my-webtest-my-component" --retry-enabled true --synthetic-monitor-id "my-webtest-my-component" --timeout 120 --resource-group "my-resource-group" --name "my-webtest-my-component" --tags hidden-link:XX=XX
webTestCreateStandard
az monitor app-insights web-test create --location "South Central US" --description "Ping web test alert for mytestwebapp" --enabled true --frequency 900 --web-test-kind "standard" --locations Id="us-fl-mia-edge" --defined-web-test-name "my-webtest-my-component" --http-verb "POST" --request-body "SGVsbG8gd29ybGQ=" --request-url "https://bing.com" --retry-enabled true --synthetic-monitor-id "my-webtest-my-component" --timeout 120 --ssl-lifetime-check 100 --ssl-check true --resource-group "my-resource-group" --name "my-webtest-my-component" --tags hidden-link:XX=XX
Required Parameters
The name of the Application Insights WebTest resource.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The collection of content validation properties.
Usage: --content-validation content-match=XX ignore-case=XX pass-if-text-found=XX
content-match: Content to look for in the return of the WebTest. Must not be null or empty. ignore-case: When set, this value makes the ContentMatch validation case insensitive. pass-if-text-found: When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match.
Property | Value |
---|---|
Parameter group: | Validation Rules Arguments |
User defined name if this WebTest.
User defined description for this WebTest.
Is the test actively being monitored.
Property | Value |
---|---|
Accepted values: | false, true |
Validate that the WebTest returns the http status code provided.
Property | Value |
---|---|
Parameter group: | Validation Rules Arguments |
Follow redirects for this web test.
Property | Value |
---|---|
Parameter group: | Request Arguments |
Accepted values: | false, true |
Interval in seconds between test runs for this WebTest. Default value is 300.
List of headers and their values to add to the WebTest call.
Usage: --headers key=XX value=XX
key: The name of the header. value: The value of the header.
Multiple actions can be specified by using more than one --headers argument.
Property | Value |
---|---|
Parameter group: | Request Arguments |
Http verb to use for this web test.
Property | Value |
---|---|
Parameter group: | Request Arguments |
When set, validation will ignore the status code.
Property | Value |
---|---|
Parameter group: | Validation Rules Arguments |
Accepted values: | false, true |
The kind of WebTest that this web test watches. Choices are ping and multistep.
Property | Value |
---|---|
Accepted values: | multistep, ping |
Location. Values from: az account list-locations
. You can configure the default location using az configure --defaults location=<location>
.
A list of where to physically run the tests from to give global coverage for accessibility of your application.
Usage: --locations Id=XX
Id: Location ID for the WebTest to run from.
Multiple actions can be specified by using more than one --locations argument.
Parse Dependent request for this WebTest.
Property | Value |
---|---|
Parameter group: | Request Arguments |
Accepted values: | false, true |
Base64 encoded string body to send with this web test.
Property | Value |
---|---|
Parameter group: | Request Arguments |
Url location to test.
Property | Value |
---|---|
Parameter group: | Request Arguments |
Allow for retries should this WebTest fail.
Property | Value |
---|---|
Accepted values: | false, true |
Checks to see if the SSL cert is still valid.
Property | Value |
---|---|
Parameter group: | Validation Rules Arguments |
Accepted values: | false, true |
A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck must be set to true.
Property | Value |
---|---|
Parameter group: | Validation Rules Arguments |
Unique ID of this WebTest. This is typically the same value as the Name field.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Seconds until this WebTest will timeout and fail. Default value is 30.
The XML specification of a WebTest to run against an application.
Property | Value |
---|---|
Parameter group: | Configuration Arguments |
The kind of web test this is, valid choices are ping, multistep and standard.
Property | Value |
---|---|
Accepted values: | multistep, ping, standard |
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 app-insights web-test delete
Delete an Application Insights web test.
az monitor app-insights web-test delete --name --web-test-name
--resource-group
[--yes]
Examples
webTestDelete
az monitor app-insights web-test delete --resource-group "my-resource-group" --name "my-webtest-01-mywebservice"
Required Parameters
The name of the Application Insights WebTest resource.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
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 app-insights web-test list
Get all Application Insights web tests defined for the specified component. And Get all Application Insights web tests defined within a specified resource group. And Get all Application Insights web test alerts definitions within a subscription.
az monitor app-insights web-test list [--component-name]
[--resource-group]
Examples
webTestListByComponent
az monitor app-insights web-test list --component-name "my-component" --resource-group "my-resource-group"
webTestListByResourceGroup
az monitor app-insights web-test list --resource-group "my-resource-group"
webTestList
az monitor app-insights web-test list
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The name of the Application Insights component resource.
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 monitor app-insights web-test show
Get a specific Application Insights web test definition.
az monitor app-insights web-test show --name --web-test-name
--resource-group
Examples
webTestGet
az monitor app-insights web-test show --resource-group "my-resource-group" --name "my-webtest-01-mywebservice"
Required Parameters
The name of the Application Insights WebTest resource.
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 monitor app-insights web-test update
Update an Application Insights web test definition.
az monitor app-insights web-test update --name --web-test-name
--resource-group
[--add]
[--content-validation]
[--defined-web-test-name]
[--description]
[--enabled {false, true}]
[--expected-status-code]
[--follow-redirects {false, true}]
[--force-string]
[--frequency]
[--headers]
[--http-verb]
[--ignore-status-code {false, true}]
[--kind {multistep, ping}]
[--location]
[--locations]
[--parse-requests {false, true}]
[--remove]
[--request-body]
[--request-url]
[--retry-enabled {false, true}]
[--set]
[--ssl-check {false, true}]
[--ssl-lifetime-check]
[--synthetic-monitor-id]
[--tags]
[--timeout]
[--web-test]
[--web-test-kind {multistep, ping, standard}]
Examples
webTestUpdate
az monitor app-insights web-test update --kind "ping" --location "South Central US" --web-test "<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"30\" WorkItemIds=\"\" xmlns=\"http://microsoft.com/schemas/VisualStudio/TeamTest/2010\" Description=\"\" CredentialUserName=\"\" CredentialPassword=\"\" PreAuthenticate=\"True\" Proxy=\"default\" StopOnError=\"False\" RecordedResultFile=\"\" ResultsLocale=\"\" ><Items><Request Method=\"GET\" Guid=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"30\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>" --frequency 600 --web-test-kind "ping" --locations Id="us-fl-mia-edge" --locations Id="apac-hk-hkn-azr" --defined-web-test-name "my-webtest-my-component" --synthetic-monitor-id "my-webtest-my-component" --timeout 30 --resource-group "my-resource-group" --name "my-webtest-my-component"
Required Parameters
The name of the Application Insights WebTest resource.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
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 |
Default value: | [] |
The collection of content validation properties.
Usage: --content-validation content-match=XX ignore-case=XX pass-if-text-found=XX
content-match: Content to look for in the return of the WebTest. Must not be null or empty. ignore-case: When set, this value makes the ContentMatch validation case insensitive. pass-if-text-found: When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match.
Property | Value |
---|---|
Parameter group: | Validation Rules Arguments |
User defined name if this WebTest.
User defined description for this WebTest.
Is the test actively being monitored.
Property | Value |
---|---|
Accepted values: | false, true |
Validate that the WebTest returns the http status code provided.
Property | Value |
---|---|
Parameter group: | Validation Rules Arguments |
Follow redirects for this web test.
Property | Value |
---|---|
Parameter group: | Request Arguments |
Accepted values: | false, true |
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
Default value: | False |
Interval in seconds between test runs for this WebTest. Default value is 300.
List of headers and their values to add to the WebTest call.
Usage: --headers key=XX value=XX
key: The name of the header. value: The value of the header.
Multiple actions can be specified by using more than one --headers argument.
Property | Value |
---|---|
Parameter group: | Request Arguments |
Http verb to use for this web test.
Property | Value |
---|---|
Parameter group: | Request Arguments |
When set, validation will ignore the status code.
Property | Value |
---|---|
Parameter group: | Validation Rules Arguments |
Accepted values: | false, true |
The kind of WebTest that this web test watches. Choices are ping and multistep.
Property | Value |
---|---|
Accepted values: | multistep, ping |
Location. Values from: az account list-locations
. You can configure the default location using az configure --defaults location=<location>
.
A list of where to physically run the tests from to give global coverage for accessibility of your application.
Usage: --locations Id=XX
Id: Location ID for the WebTest to run from.
Multiple actions can be specified by using more than one --locations argument.
Parse Dependent request for this WebTest.
Property | Value |
---|---|
Parameter group: | Request Arguments |
Accepted values: | false, true |
Remove a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
Default value: | [] |
Base64 encoded string body to send with this web test.
Property | Value |
---|---|
Parameter group: | Request Arguments |
Url location to test.
Property | Value |
---|---|
Parameter group: | Request Arguments |
Allow for retries should this WebTest fail.
Property | Value |
---|---|
Accepted values: | false, true |
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Property | Value |
---|---|
Parameter group: | Generic Update Arguments |
Default value: | [] |
Checks to see if the SSL cert is still valid.
Property | Value |
---|---|
Parameter group: | Validation Rules Arguments |
Accepted values: | false, true |
A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck must be set to true.
Property | Value |
---|---|
Parameter group: | Validation Rules Arguments |
Unique ID of this WebTest. This is typically the same value as the Name field.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Seconds until this WebTest will timeout and fail. Default value is 30.
The XML specification of a WebTest to run against an application.
Property | Value |
---|---|
Parameter group: | Configuration Arguments |
The kind of web test this is, valid choices are ping, multistep and standard.
Property | Value |
---|---|
Accepted values: | multistep, ping, standard |
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 |