Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Bicep resource definition
The webtests resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Insights/webtests resource, add the following Bicep to your template.
resource symbolicname 'Microsoft.Insights/webtests@2015-05-01' = {
scope: resourceSymbolicName or scope
kind: 'string'
location: 'string'
name: 'string'
properties: {
Configuration: {
WebTest: 'string'
}
Description: 'string'
Enabled: bool
Frequency: int
Kind: 'string'
Locations: [
{
Id: 'string'
}
]
Name: 'string'
RetryEnabled: bool
SyntheticMonitorId: 'string'
Timeout: int
}
tags: {
{customized property}: 'string'
}
}
Property Values
Microsoft.Insights/webtests
| Name | Description | Value |
|---|---|---|
| kind | The kind of web test that this web test watches. Choices are ping and multistep. | 'multistep' 'ping' |
| location | Resource location | string (required) |
| name | The resource name | string (required) |
| properties | Metadata describing a web test for an Azure resource. | WebTestProperties |
| scope | Use when creating a resource at a scope that is different than the deployment scope. | Set this property to the symbolic name of a resource to apply the extension resource. |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
WebTestGeolocation
| Name | Description | Value |
|---|---|---|
| Id | Location ID for the webtest to run from. | string |
WebTestProperties
| Name | Description | Value |
|---|---|---|
| Configuration | An XML configuration specification for a WebTest. | WebTestPropertiesConfiguration |
| Description | Purpose/user defined descriptive test for this WebTest. | string |
| Enabled | Is the test actively being monitored. | bool |
| Frequency | Interval in seconds between test runs for this WebTest. Default value is 300. | int |
| Kind | The kind of web test this is, valid choices are ping and multistep. | 'multistep' 'ping' (required) |
| Locations | A list of where to physically run the tests from to give global coverage for accessibility of your application. | WebTestGeolocation[] (required) |
| Name | User defined name if this WebTest. | string (required) |
| RetryEnabled | Allow for retries should this WebTest fail. | bool |
| SyntheticMonitorId | Unique ID of this WebTest. This is typically the same value as the Name field. | string (required) |
| Timeout | Seconds until this WebTest will timeout and fail. Default value is 30. | int |
WebTestPropertiesConfiguration
| Name | Description | Value |
|---|---|---|
| WebTest | The XML specification of a WebTest to run against an application. | string |
WebtestsResourceTags
| Name | Description | Value |
|---|
Usage Examples
Azure Verified Modules
The following Azure Verified Modules can be used to deploy this resource type.
| Module | Description |
|---|---|
| Web Test | AVM Resource Module for Web Test |
ARM template resource definition
The webtests resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Insights/webtests resource, add the following JSON to your template.
{
"type": "Microsoft.Insights/webtests",
"apiVersion": "2015-05-01",
"name": "string",
"kind": "string",
"location": "string",
"properties": {
"Configuration": {
"WebTest": "string"
},
"Description": "string",
"Enabled": "bool",
"Frequency": "int",
"Kind": "string",
"Locations": [
{
"Id": "string"
}
],
"Name": "string",
"RetryEnabled": "bool",
"SyntheticMonitorId": "string",
"Timeout": "int"
},
"tags": {
"{customized property}": "string"
}
}
Property Values
Microsoft.Insights/webtests
| Name | Description | Value |
|---|---|---|
| apiVersion | The api version | '2015-05-01' |
| kind | The kind of web test that this web test watches. Choices are ping and multistep. | 'multistep' 'ping' |
| location | Resource location | string (required) |
| name | The resource name | string (required) |
| properties | Metadata describing a web test for an Azure resource. | WebTestProperties |
| tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
| type | The resource type | 'Microsoft.Insights/webtests' |
WebTestGeolocation
| Name | Description | Value |
|---|---|---|
| Id | Location ID for the webtest to run from. | string |
WebTestProperties
| Name | Description | Value |
|---|---|---|
| Configuration | An XML configuration specification for a WebTest. | WebTestPropertiesConfiguration |
| Description | Purpose/user defined descriptive test for this WebTest. | string |
| Enabled | Is the test actively being monitored. | bool |
| Frequency | Interval in seconds between test runs for this WebTest. Default value is 300. | int |
| Kind | The kind of web test this is, valid choices are ping and multistep. | 'multistep' 'ping' (required) |
| Locations | A list of where to physically run the tests from to give global coverage for accessibility of your application. | WebTestGeolocation[] (required) |
| Name | User defined name if this WebTest. | string (required) |
| RetryEnabled | Allow for retries should this WebTest fail. | bool |
| SyntheticMonitorId | Unique ID of this WebTest. This is typically the same value as the Name field. | string (required) |
| Timeout | Seconds until this WebTest will timeout and fail. Default value is 30. | int |
WebTestPropertiesConfiguration
| Name | Description | Value |
|---|---|---|
| WebTest | The XML specification of a WebTest to run against an application. | string |
WebtestsResourceTags
| Name | Description | Value |
|---|
Usage Examples
Azure Quickstart Templates
The following Azure Quickstart templates deploy this resource type.
| Template | Description |
|---|---|
| Dynamic Web Test Creation |
Create any number of App Insights web (ping) tests. |
| Metric alert rule for an availability test |
This template creates an Application Insights availability test along with a metric alert rule that monitors it. |
Terraform (AzAPI provider) resource definition
The webtests resource type can be deployed with operations that target:
For a list of changed properties in each API version, see change log.
Resource format
To create a Microsoft.Insights/webtests resource, add the following Terraform to your template.
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Insights/webtests@2015-05-01"
name = "string"
parent_id = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = {
kind = "string"
properties = {
Configuration = {
WebTest = "string"
}
Description = "string"
Enabled = bool
Frequency = int
Kind = "string"
Locations = [
{
Id = "string"
}
]
Name = "string"
RetryEnabled = bool
SyntheticMonitorId = "string"
Timeout = int
}
}
}
Property Values
Microsoft.Insights/webtests
| Name | Description | Value |
|---|---|---|
| kind | The kind of web test that this web test watches. Choices are ping and multistep. | 'multistep' 'ping' |
| location | Resource location | string (required) |
| name | The resource name | string (required) |
| parent_id | The ID of the resource to apply this extension resource to. | string (required) |
| properties | Metadata describing a web test for an Azure resource. | WebTestProperties |
| tags | Resource tags | Dictionary of tag names and values. |
| type | The resource type | "Microsoft.Insights/webtests@2015-05-01" |
WebTestGeolocation
| Name | Description | Value |
|---|---|---|
| Id | Location ID for the webtest to run from. | string |
WebTestProperties
| Name | Description | Value |
|---|---|---|
| Configuration | An XML configuration specification for a WebTest. | WebTestPropertiesConfiguration |
| Description | Purpose/user defined descriptive test for this WebTest. | string |
| Enabled | Is the test actively being monitored. | bool |
| Frequency | Interval in seconds between test runs for this WebTest. Default value is 300. | int |
| Kind | The kind of web test this is, valid choices are ping and multistep. | 'multistep' 'ping' (required) |
| Locations | A list of where to physically run the tests from to give global coverage for accessibility of your application. | WebTestGeolocation[] (required) |
| Name | User defined name if this WebTest. | string (required) |
| RetryEnabled | Allow for retries should this WebTest fail. | bool |
| SyntheticMonitorId | Unique ID of this WebTest. This is typically the same value as the Name field. | string (required) |
| Timeout | Seconds until this WebTest will timeout and fail. Default value is 30. | int |
WebTestPropertiesConfiguration
| Name | Description | Value |
|---|---|---|
| WebTest | The XML specification of a WebTest to run against an application. | string |
WebtestsResourceTags
| Name | Description | Value |
|---|
Usage Examples
Terraform Samples
A basic example of deploying Application Insights Standard WebTest.
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "component" {
type = "Microsoft.Insights/components@2020-02-02"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
kind = "web"
properties = {
Application_Type = "web"
DisableIpMasking = false
DisableLocalAuth = false
ForceCustomerStorageForProfiler = false
RetentionInDays = 90
SamplingPercentage = 100
publicNetworkAccessForIngestion = "Enabled"
publicNetworkAccessForQuery = "Enabled"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
resource "azapi_resource" "webTest" {
type = "Microsoft.Insights/webTests@2022-06-15"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
kind = "standard"
properties = {
Description = ""
Enabled = false
Frequency = 300
Kind = "standard"
Locations = [
{
Id = "us-tx-sn1-azr"
},
]
Name = var.resource_name
Request = {
FollowRedirects = false
Headers = [
{
key = "x-header"
value = "testheader"
},
{
key = "x-header-2"
value = "testheader2"
},
]
HttpVerb = "GET"
ParseDependentRequests = false
RequestUrl = "http://microsoft.com"
}
RetryEnabled = false
SyntheticMonitorId = var.resource_name
Timeout = 30
ValidationRules = {
ExpectedHttpStatusCode = 200
SSLCheck = false
}
}
tags = {
"hidden-link:${azapi_resource.component.id}" = "Resource"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}