- Article
- Latest
- 2022-06-15
- 2020-10-05-preview
- 2018-05-01-preview
- 2015-05-01
Bicep resource definition
The webtests resource type can be deployed to:
- Resource groups - See resource group deployment commands
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@2022-06-15' = { name: 'string' location: 'string' tags: { tagName1: 'tagValue1' tagName2: 'tagValue2' } kind: 'string' properties: { Configuration: { WebTest: 'string' } Description: 'string' Enabled: bool Frequency: int Kind: 'string' Locations: [ { Id: 'string' } ] Name: 'string' Request: { FollowRedirects: bool Headers: [ { key: 'string' value: 'string' } ] HttpVerb: 'string' ParseDependentRequests: bool RequestBody: 'string' RequestUrl: 'string' } RetryEnabled: bool SyntheticMonitorId: 'string' Timeout: int ValidationRules: { ContentValidation: { ContentMatch: 'string' IgnoreCase: bool PassIfTextFound: bool } ExpectedHttpStatusCode: int IgnoreHttpsStatusCode: bool SSLCertRemainingLifetimeCheck: int SSLCheck: bool } }}
Property values
webtests
Name | Description | Value |
---|---|---|
name | The resource name | string (required) |
location | Resource location | string (required) |
tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
kind | The kind of WebTest that this web test watches. Choices are ping, multistep and standard. | 'multistep' 'ping' 'standard' |
properties | Metadata describing a web test for an Azure resource. | WebTestProperties |
WebTestProperties
Name | Description | Value |
---|---|---|
Configuration | An XML configuration specification for a WebTest. | WebTestPropertiesConfiguration |
Description | User defined description 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, multistep and standard. | 'multistep' 'ping' 'standard' (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) |
Request | The collection of request properties | WebTestPropertiesRequest |
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 |
ValidationRules | The collection of validation rule properties | WebTestPropertiesValidationRules |
WebTestPropertiesConfiguration
Name | Description | Value |
---|---|---|
WebTest | The XML specification of a WebTest to run against an application. | string |
WebTestGeolocation
Name | Description | Value |
---|---|---|
Id | Location ID for the WebTest to run from. | string |
WebTestPropertiesRequest
Name | Description | Value |
---|---|---|
FollowRedirects | Follow redirects for this web test. | bool |
Headers | List of headers and their values to add to the WebTest call. | HeaderField[] |
HttpVerb | Http verb to use for this web test. | string |
ParseDependentRequests | Parse Dependent request for this WebTest. | bool |
RequestBody | Base64 encoded string body to send with this web test. | string |
RequestUrl | Url location to test. | string |
HeaderField
Name | Description | Value |
---|---|---|
key | The name of the header. | string |
value | The value of the header. | string |
WebTestPropertiesValidationRules
Name | Description | Value |
---|---|---|
ContentValidation | The collection of content validation properties | WebTestPropertiesValidationRulesContentValidation |
ExpectedHttpStatusCode | Validate that the WebTest returns the http status code provided. | int |
IgnoreHttpsStatusCode | When set, validation will ignore the status code. | bool |
SSLCertRemainingLifetimeCheck | 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. | int |
SSLCheck | Checks to see if the SSL cert is still valid. | bool |
WebTestPropertiesValidationRulesContentValidation
Name | Description | Value |
---|---|---|
ContentMatch | Content to look for in the return of the WebTest. Must not be null or empty. | string |
IgnoreCase | When set, this value makes the ContentMatch validation case insensitive. | bool |
PassIfTextFound | When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match | bool |
Quickstart templates
The following 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. |
ARM template resource definition
The webtests resource type can be deployed to:
- Resource groups - See resource group deployment commands
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": "2022-06-15", "name": "string", "location": "string", "tags": { "tagName1": "tagValue1", "tagName2": "tagValue2" }, "kind": "string", "properties": { "Configuration": { "WebTest": "string" }, "Description": "string", "Enabled": "bool", "Frequency": "int", "Kind": "string", "Locations": [ { "Id": "string" } ], "Name": "string", "Request": { "FollowRedirects": "bool", "Headers": [ { "key": "string", "value": "string" } ], "HttpVerb": "string", "ParseDependentRequests": "bool", "RequestBody": "string", "RequestUrl": "string" }, "RetryEnabled": "bool", "SyntheticMonitorId": "string", "Timeout": "int", "ValidationRules": { "ContentValidation": { "ContentMatch": "string", "IgnoreCase": "bool", "PassIfTextFound": "bool" }, "ExpectedHttpStatusCode": "int", "IgnoreHttpsStatusCode": "bool", "SSLCertRemainingLifetimeCheck": "int", "SSLCheck": "bool" } }}
Property values
webtests
Name | Description | Value |
---|---|---|
type | The resource type | 'Microsoft.Insights/webtests' |
apiVersion | The resource api version | '2022-06-15' |
name | The resource name | string (required) |
location | Resource location | string (required) |
tags | Resource tags | Dictionary of tag names and values. See Tags in templates |
kind | The kind of WebTest that this web test watches. Choices are ping, multistep and standard. | 'multistep' 'ping' 'standard' |
properties | Metadata describing a web test for an Azure resource. | WebTestProperties |
WebTestProperties
Name | Description | Value |
---|---|---|
Configuration | An XML configuration specification for a WebTest. | WebTestPropertiesConfiguration |
Description | User defined description 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, multistep and standard. | 'multistep' 'ping' 'standard' (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) |
Request | The collection of request properties | WebTestPropertiesRequest |
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 |
ValidationRules | The collection of validation rule properties | WebTestPropertiesValidationRules |
WebTestPropertiesConfiguration
Name | Description | Value |
---|---|---|
WebTest | The XML specification of a WebTest to run against an application. | string |
WebTestGeolocation
Name | Description | Value |
---|---|---|
Id | Location ID for the WebTest to run from. | string |
WebTestPropertiesRequest
Name | Description | Value |
---|---|---|
FollowRedirects | Follow redirects for this web test. | bool |
Headers | List of headers and their values to add to the WebTest call. | HeaderField[] |
HttpVerb | Http verb to use for this web test. | string |
ParseDependentRequests | Parse Dependent request for this WebTest. | bool |
RequestBody | Base64 encoded string body to send with this web test. | string |
RequestUrl | Url location to test. | string |
HeaderField
Name | Description | Value |
---|---|---|
key | The name of the header. | string |
value | The value of the header. | string |
WebTestPropertiesValidationRules
Name | Description | Value |
---|---|---|
ContentValidation | The collection of content validation properties | WebTestPropertiesValidationRulesContentValidation |
ExpectedHttpStatusCode | Validate that the WebTest returns the http status code provided. | int |
IgnoreHttpsStatusCode | When set, validation will ignore the status code. | bool |
SSLCertRemainingLifetimeCheck | 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. | int |
SSLCheck | Checks to see if the SSL cert is still valid. | bool |
WebTestPropertiesValidationRulesContentValidation
Name | Description | Value |
---|---|---|
ContentMatch | Content to look for in the return of the WebTest. Must not be null or empty. | string |
IgnoreCase | When set, this value makes the ContentMatch validation case insensitive. | bool |
PassIfTextFound | When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match | bool |
Quickstart templates
The following 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 to:
- Resource groups
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@2022-06-15" name = "string" location = "string" parent_id = "string" tags = { tagName1 = "tagValue1" tagName2 = "tagValue2" } body = jsonencode({ properties = { Configuration = { WebTest = "string" } Description = "string" Enabled = bool Frequency = int Kind = "string" Locations = [ { Id = "string" } ] Name = "string" Request = { FollowRedirects = bool Headers = [ { key = "string" value = "string" } ] HttpVerb = "string" ParseDependentRequests = bool RequestBody = "string" RequestUrl = "string" } RetryEnabled = bool SyntheticMonitorId = "string" Timeout = int ValidationRules = { ContentValidation = { ContentMatch = "string" IgnoreCase = bool PassIfTextFound = bool } ExpectedHttpStatusCode = int IgnoreHttpsStatusCode = bool SSLCertRemainingLifetimeCheck = int SSLCheck = bool } } kind = "string" })}
Property values
webtests
Name | Description | Value |
---|---|---|
type | The resource type | "Microsoft.Insights/webtests@2022-06-15" |
name | The resource name | string (required) |
location | Resource location | string (required) |
parent_id | To deploy to a resource group, use the ID of that resource group. | string (required) |
tags | Resource tags | Dictionary of tag names and values. |
kind | The kind of WebTest that this web test watches. Choices are ping, multistep and standard. | "multistep" "ping" "standard" |
properties | Metadata describing a web test for an Azure resource. | WebTestProperties |
WebTestProperties
Name | Description | Value |
---|---|---|
Configuration | An XML configuration specification for a WebTest. | WebTestPropertiesConfiguration |
Description | User defined description 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, multistep and standard. | "multistep" "ping" "standard" (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) |
Request | The collection of request properties | WebTestPropertiesRequest |
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 |
ValidationRules | The collection of validation rule properties | WebTestPropertiesValidationRules |
WebTestPropertiesConfiguration
Name | Description | Value |
---|---|---|
WebTest | The XML specification of a WebTest to run against an application. | string |
WebTestGeolocation
Name | Description | Value |
---|---|---|
Id | Location ID for the WebTest to run from. | string |
WebTestPropertiesRequest
Name | Description | Value |
---|---|---|
FollowRedirects | Follow redirects for this web test. | bool |
Headers | List of headers and their values to add to the WebTest call. | HeaderField[] |
HttpVerb | Http verb to use for this web test. | string |
ParseDependentRequests | Parse Dependent request for this WebTest. | bool |
RequestBody | Base64 encoded string body to send with this web test. | string |
RequestUrl | Url location to test. | string |
HeaderField
Name | Description | Value |
---|---|---|
key | The name of the header. | string |
value | The value of the header. | string |
WebTestPropertiesValidationRules
Name | Description | Value |
---|---|---|
ContentValidation | The collection of content validation properties | WebTestPropertiesValidationRulesContentValidation |
ExpectedHttpStatusCode | Validate that the WebTest returns the http status code provided. | int |
IgnoreHttpsStatusCode | When set, validation will ignore the status code. | bool |
SSLCertRemainingLifetimeCheck | 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. | int |
SSLCheck | Checks to see if the SSL cert is still valid. | bool |
WebTestPropertiesValidationRulesContentValidation
Name | Description | Value |
---|---|---|
ContentMatch | Content to look for in the return of the WebTest. Must not be null or empty. | string |
IgnoreCase | When set, this value makes the ContentMatch validation case insensitive. | bool |
PassIfTextFound | When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match | bool |
FAQs
What is the difference between ARM template and terraform? ›
To choose between the two, consider your project's needs and features. For instance, Terraform stores credentials in plain text in the state file, while ARM templates do not have a state file. If you are an engineer concerned with securing your configuration files, you might choose ARM templates over Terraform.
How do you reference a resource in Bicep? ›To reference an existing resource that isn't deployed in your current Bicep file, declare the resource with the existing keyword. Use the existing keyword when you're deploying a resource that needs to get a value from an existing resource. You access the existing resource's properties through its symbolic name.
What is reference in ARM template? ›Reference() Function Explained With Examples - ARM Template. In this post, we will review reference() function which often comes handy when working with ARM templates. This function allows to retrieving runtime state of a resource which contains useful information such as URIs, names or other settings.
What is Bicep ARM template? ›Bicep is a transparent abstraction over ARM template JSON and doesn't lose any of the JSON template capabilities. During deployment, the Bicep CLI converts a Bicep file into ARM template JSON. Resource types, API versions, and properties that are valid in an ARM template are valid in a Bicep file.
Is Terraform better than Bicep? ›Bicep is Azure-specific and not designed to work with other cloud services. If your goal is to automate deployments to any of the following environments, Terraform is likely the better option: Virtualization environments. Multicloud scenarios - such as Azure and other cloud(s)
Why use Terraform over ARM templates? ›ARM templates are all created in one file. By contrast, Terraform evaluates every resource in the directory with a . tf extension -- and will do so for every command that runs the resource, which enables IT admins to break up resources into separate files to ease parsing.
How do you convert an arm template to a Bicep? ›Decompile using the Bicep Playground
You can decompile your ARM template into a Bicep template. To convert your template, you only need to select the “Decompile” option and upload your ARM template, and you will get the Bicep file. Another option you have is to convert your Bicep template into an ARM template.
Deploy the Bicep file
Right-click the Bicep file inside the VSCode, and then select Deploy Bicep file. From the Select Resource Group listbox on the top, select Create new Resource Group.
- Copy the following Bicep module and save it to your computer as storage. ...
- Replace <subscriptionId> in the module. ...
- Use Azure PowerShell or Azure CLI to create a new resource group for the storage account. ...
- Deploy the template spec with Azure PowerShell or Azure CLI.
What are ARM templates, and why should I use them? ARM templates are JSON files where you define what you want to deploy to Azure. Templates help you implement an infrastructure-as-code solution for Azure. Your organization can repeatedly and reliably deploy the required infrastructure to different environments.
What is the difference between Azure ARM and Bicep? ›
The first noticeable difference is that the bicep template is only half the size of that of ARM. Firstly, the parameters are more compact as the type, name, and default value can all be written in a single line. Secondly, Bicep is smart enough to determine if resources depend on each other.
What is the difference between ARM Bicep and JSON? ›The Bicep ternary operator is the equivalent to the if function in an ARM template JSON, not the condition property. The ternary syntax has to evaluate to one value or the other. If the condition is false in the preceding samples, Bicep outputs a hostname with an empty string, but JSON outputs no values.
What is the alternative to Bicep in Azure? ›On Azure, three of the most obvious choices for Infrastructure as Code (IaC) are Bicep, Terraform, and Pulumi. Bicep is Microsoft's own domain-specific language, whereas Terraform is the open-source tool that is cloud agnostic.
Can we call ARM template from Terraform? ›Deploying ARM Templates with Terraform
HashiCorp Terraform has a resource called azurerm_resource_group_template_deployment for the AzureRM provider. This resource allows you to deploy an ARM Template through HashiCorp Terraform.
There's a tool called aztfy which can create terraform code from an existing environment, but there are currently no tools to transform ARM and CLI to native terraform.
What is the difference between Terraform and cloud formation template? ›What is the difference between Terraform and CloudFormation? Terraform and CloudFormation are both infrastructure-as-code (IaC) tools. CloudFormation is developed by AWS and only manages AWS resources. Terraform is developed by HashiCorp and can manage resources across a wide range of cloud vendors.
What is the difference between Terraform and bicep? ›It's a cloud-agnostic tool, meaning it can manage resources across Azure, AWS, Google Cloud, and others. This makes Terraform a great choice for multi-cloud environments. Bicep, however, is Azure-specific. It's deeply integrated with Azure and provides a first-class experience for Azure resource management.