Web Test

Overview

{
	"name": "sample-webtest-name",
	"test_locations": [
		"WestEurope",
		"WestUs",
		"UKSouth",
		"SoutheastAsia",
		"EastUS"
	],
	"request": {
		"http_verb": "GET",
		"url": "http://example.com",
		"parse_dependent_requests": true,
		"headers": {
			"Content-Type": "application/json"
		},
		"follow_redirects": true,
		"body": "Request body content"
	},
	"validation_rules": {
		"ssl_cert": false,
		"ssl_cert_remaining_days": 30,
		"ignore_http_status": false,
		"expected_status_code": 200,
		"content_validation": {
			"content_match": "Expected content",
			"ignore_case": false,
			"pass_if_found": true
		}
	},
	"frequency": 300,
	"timeout": 30,
	"retry": false,
	"enabled": true,
	"description": "Detailed description of the web test",
	"@application_insights_name": "sample-app-insights",
	"location": "northeurope",
	"external": false,
	"resource_group_name": "my-rg-name",
	"tags": { "example": "S0" }
}

Web Test Reference

KeyTypeDescription
name (required)stringThe name of the Web Test (see how to name)
test_locations (required)Test Locations[]The test locations
request (required)RequestThe request configuration
validation_rules (required)Validation RulesThe validation rules for the test (defaults to no validation rules)
frequencyintThe frequency of the test in seconds (defaults to 300)
timeoutintThe timeout of the test in seconds (defaults to 30)
retryboolWhether or not to retry the test (defaults to false)
enabledboolWhether or not the test is enabled (defaults to true)
locationstringResource Location (defaults to the resource group location)
externalboolA reference to an existing Container Registry (defaults to false)
resource_group_namestringThe name of the resource group where the resource is located, only with external resources (defaults to the resource group of the deployment)
tagsobjectAdditional tags for the resource (defaults to no additional tags)

TestLocations

ValueDescription
AustraliaEastAustralia East
BrazilSouthBrazil South
CentralUSCentral US
EastAsiaEast Asia
EastUSEast US
FranceCentralFrance Central
FranceSouthFrance South
JapanEastJapan East
NorthCentralUSNorth Central US
NorthEuropeNorth Europe
SouthCentralUSSouth Central US
SoutheastAsiaSoutheast Asia
UKSouthUK South
UKWestUK West
WestEuropeWest Europe
WestUSWest US

Request

KeyTypeDescription
http_verb (required)HTTP verbThe HTTP verb to use
url (required)stringThe URL to use for the web test
parse_dependent_requests (required)boolWhether or not to parse dependent requests
headersObjectThe headers to use for the request
follow_redirectsboolWhether or not to follow redirects
bodystringThe body content of the request

HTTPVerb

ValueDescription
GETGET
HEADHEAD
POSTPOST
PUTPUT
PATCHPATCH
DELETEDELETE
OPTIONSOPTIONS

ValidationRules

KeyTypeDescription
expected_status_code (required)intThe expected status code (defaults to 200)
ssl_certboolWhether or not to validate the SSL certificate (defaults to false)
ssl_cert_remaining_daysintThe number of days remaining on the SSL certificate (no default)
ignore_http_statusboolWhether or not to ignore the HTTP status (defaults to false)
content_validationContentValidationThe content validation configuration (defaults to no content validation)

ContentValidation

KeyTypeDescription
content_match (required)stringThe content to match
pass_if_found (required)boolWhether or not to pass if found
ignore_caseboolWhether or not to ignore case (defaults to false)