az monitor app-insights web-test
Note
This reference is part of the application-insights extension for the Azure CLI (version 2.55.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
--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 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.
User defined name if this WebTest.
User defined description for this WebTest.
Is the test actively being monitored.
Validate that the WebTest returns the http status code provided.
Follow redirects for this web test.
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.
Http verb to use for this web test.
When set, validation will ignore the status code.
The kind of WebTest that this web test watches. Choices are ping and multistep.
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.
Base64 encoded string body to send with this web test.
Url location to test.
Allow for retries should this WebTest fail.
Checks to see if the SSL cert is still valid.
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.
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.
The kind of web test this is, valid choices are ping, multistep and standard.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.
az monitor app-insights web-test delete
Delete an Application Insights web test.
az monitor app-insights web-test delete --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
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.
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 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.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.
az monitor app-insights web-test show
Get a specific Application Insights web test definition.
az monitor app-insights web-test show --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.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.
az monitor app-insights web-test update
Update an Application Insights web test definition.
az monitor app-insights web-test update --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
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>
.
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.
User defined name if this WebTest.
User defined description for this WebTest.
Is the test actively being monitored.
Validate that the WebTest returns the http status code provided.
Follow redirects for this web test.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
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.
Http verb to use for this web test.
When set, validation will ignore the status code.
The kind of WebTest that this web test watches. Choices are ping and multistep.
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.
Remove a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Base64 encoded string body to send with this web test.
Url location to test.
Allow for retries should this WebTest fail.
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Checks to see if the SSL cert is still valid.
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.
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.
The kind of web test this is, valid choices are ping, multistep and standard.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.
Azure CLI