web-tests
This Bicep AVM module deploys a Web Test.
ipm add --package avm-bicep/web-tests --version 0.3.1
Web Tests [Microsoft.Insights/webtests]
This module deploys a Web Test.
Navigation
Resource Types
Resource Type | API Version |
---|---|
Microsoft.Authorization/locks |
2020-05-01 |
Microsoft.Authorization/roleAssignments |
2022-04-01 |
Microsoft.Insights/webtests |
2022-06-15 |
Usage examples
The following section provides usage examples for the module, which were used to validate and deploy the module successfully. For a full reference, please review the module's test folder in its repository.
Note: Each example lists all the required parameters first, followed by the rest - each in alphabetical order.
Note: To reference the module, please use the following syntax
./packages/web-tests/main.bicep
.
Example 1: Using only defaults
This instance deploys the module with the minimum set of required parameters.
via Bicep module
module webtest './packages/web-tests/main.bicep' = {
name: 'webtestDeployment'
params: {
// Required parameters
appInsightResourceId: '<appInsightResourceId>'
name: 'iwtmin001'
request: {
HttpVerb: 'GET'
RequestUrl: 'https://learn.microsoft.com/en-us/'
}
webTestName: 'wt$iwtmin001'
// Non-required parameters
location: '<location>'
}
}
via JSON parameters file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"appInsightResourceId": {
"value": "<appInsightResourceId>"
},
"name": {
"value": "iwtmin001"
},
"request": {
"value": {
"HttpVerb": "GET",
"RequestUrl": "https://learn.microsoft.com/en-us/"
}
},
"webTestName": {
"value": "wt$iwtmin001"
},
// Non-required parameters
"location": {
"value": "<location>"
}
}
}
via Bicep parameters file
using './packages/web-tests/main.bicep'
// Required parameters
param appInsightResourceId = '<appInsightResourceId>'
param name = 'iwtmin001'
param request = {
HttpVerb: 'GET'
RequestUrl: 'https://learn.microsoft.com/en-us/'
}
param webTestName = 'wt$iwtmin001'
// Non-required parameters
param location = '<location>'
Example 2: Using large parameter set
This instance deploys the module with most of its features enabled.
via Bicep module
module webtest './packages/web-tests/main.bicep' = {
name: 'webtestDeployment'
params: {
// Required parameters
appInsightResourceId: '<appInsightResourceId>'
name: 'iwtmax001'
request: {
HttpVerb: 'GET'
RequestUrl: 'https://learn.microsoft.com/en-us/'
}
webTestName: 'wt$iwtmax001'
// Non-required parameters
location: '<location>'
locations: [
{
Id: 'emea-nl-ams-azr'
}
]
lock: {
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
roleAssignments: [
{
name: '86bf66a0-940f-438d-977e-624c00ccb2d8'
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'Owner'
}
{
name: '<name>'
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
}
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: '<roleDefinitionIdOrName>'
}
]
syntheticMonitorId: 'iwtmax001'
tags: {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
Role: 'DeploymentValidation'
}
}
}
via JSON parameters file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"appInsightResourceId": {
"value": "<appInsightResourceId>"
},
"name": {
"value": "iwtmax001"
},
"request": {
"value": {
"HttpVerb": "GET",
"RequestUrl": "https://learn.microsoft.com/en-us/"
}
},
"webTestName": {
"value": "wt$iwtmax001"
},
// Non-required parameters
"location": {
"value": "<location>"
},
"locations": {
"value": [
{
"Id": "emea-nl-ams-azr"
}
]
},
"lock": {
"value": {
"kind": "CanNotDelete",
"name": "myCustomLockName"
}
},
"roleAssignments": {
"value": [
{
"name": "86bf66a0-940f-438d-977e-624c00ccb2d8",
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "Owner"
},
{
"name": "<name>",
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "b24988ac-6180-42a0-ab88-20f7382dd24c"
},
{
"principalId": "<principalId>",
"principalType": "ServicePrincipal",
"roleDefinitionIdOrName": "<roleDefinitionIdOrName>"
}
]
},
"syntheticMonitorId": {
"value": "iwtmax001"
},
"tags": {
"value": {
"Environment": "Non-Prod",
"hidden-title": "This is visible in the resource name",
"Role": "DeploymentValidation"
}
}
}
}
via Bicep parameters file
using './packages/web-tests/main.bicep'
// Required parameters
param appInsightResourceId = '<appInsightResourceId>'
param name = 'iwtmax001'
param request = {
HttpVerb: 'GET'
RequestUrl: 'https://learn.microsoft.com/en-us/'
}
param webTestName = 'wt$iwtmax001'
// Non-required parameters
param location = '<location>'
param locations = [
{
Id: 'emea-nl-ams-azr'
}
]
param lock = {
kind: 'CanNotDelete'
name: 'myCustomLockName'
}
param roleAssignments = [
{
name: '86bf66a0-940f-438d-977e-624c00ccb2d8'
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'Owner'
}
{
name: '<name>'
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: 'b24988ac-6180-42a0-ab88-20f7382dd24c'
}
{
principalId: '<principalId>'
principalType: 'ServicePrincipal'
roleDefinitionIdOrName: '<roleDefinitionIdOrName>'
}
]
param syntheticMonitorId = 'iwtmax001'
param tags = {
Environment: 'Non-Prod'
'hidden-title': 'This is visible in the resource name'
Role: 'DeploymentValidation'
}
Example 3: WAF-aligned
This instance deploys the module in alignment with the best-practices of the Azure Well-Architected Framework.
via Bicep module
module webtest './packages/web-tests/main.bicep' = {
name: 'webtestDeployment'
params: {
// Required parameters
appInsightResourceId: '<appInsightResourceId>'
name: 'iwtwaf001'
request: {
HttpVerb: 'GET'
RequestUrl: 'https://learn.microsoft.com/en-us/'
}
webTestName: 'wt$iwtwaf001'
// Non-required parameters
location: '<location>'
locations: [
{
Id: 'emea-nl-ams-azr'
}
]
syntheticMonitorId: 'iwtwaf001'
tags: {
'hidden-title': 'This is visible in the resource name'
}
}
}
via JSON parameters file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
// Required parameters
"appInsightResourceId": {
"value": "<appInsightResourceId>"
},
"name": {
"value": "iwtwaf001"
},
"request": {
"value": {
"HttpVerb": "GET",
"RequestUrl": "https://learn.microsoft.com/en-us/"
}
},
"webTestName": {
"value": "wt$iwtwaf001"
},
// Non-required parameters
"location": {
"value": "<location>"
},
"locations": {
"value": [
{
"Id": "emea-nl-ams-azr"
}
]
},
"syntheticMonitorId": {
"value": "iwtwaf001"
},
"tags": {
"value": {
"hidden-title": "This is visible in the resource name"
}
}
}
}
via Bicep parameters file
using './packages/web-tests/main.bicep'
// Required parameters
param appInsightResourceId = '<appInsightResourceId>'
param name = 'iwtwaf001'
param request = {
HttpVerb: 'GET'
RequestUrl: 'https://learn.microsoft.com/en-us/'
}
param webTestName = 'wt$iwtwaf001'
// Non-required parameters
param location = '<location>'
param locations = [
{
Id: 'emea-nl-ams-azr'
}
]
param syntheticMonitorId = 'iwtwaf001'
param tags = {
'hidden-title': 'This is visible in the resource name'
}
Parameters
Required parameters
Parameter | Type | Description |
---|---|---|
appInsightResourceId |
string | Resource ID of the App Insights resource to link with this webtest. |
name |
string | Name of the webtest. |
request |
object | The collection of request properties. |
webTestName |
string | User defined name if this WebTest. |
Optional parameters
Parameter | Type | Description |
---|---|---|
configuration |
object | An XML configuration specification for a WebTest. |
description |
string | User defined description for this WebTest. |
enabled |
bool | Is the test actively being monitored. |
enableTelemetry |
bool | Enable/Disable usage telemetry for module. |
frequency |
int | Interval in seconds between test runs for this WebTest. |
kind |
string | The kind of WebTest that this web test watches. |
location |
string | Location for all Resources. |
locations |
array | List of where to physically run the tests from to give global coverage for accessibility of your application. |
lock |
object | The lock settings of the service. |
retryEnabled |
bool | Allow for retries should this WebTest fail. |
roleAssignments |
array | Array of role assignments to create. |
syntheticMonitorId |
string | Unique ID of this WebTest. |
tags |
object | Resource tags. Note: a mandatory tag 'hidden-link' based on the 'appInsightResourceId' parameter will be automatically added to the tags defined here. |
timeout |
int | Seconds until this WebTest will timeout and fail. |
validationRules |
object | The collection of validation rule properties. |
Parameter: appInsightResourceId
Resource ID of the App Insights resource to link with this webtest.
- Required: Yes
- Type: string
Parameter: name
Name of the webtest.
- Required: Yes
- Type: string
Parameter: request
The collection of request properties.
- Required: Yes
- Type: object
Parameter: webTestName
User defined name if this WebTest.
- Required: Yes
- Type: string
Parameter: configuration
An XML configuration specification for a WebTest.
- Required: No
- Type: object
Parameter: description
User defined description for this WebTest.
- Required: No
- Type: string
- Default:
''
Parameter: enabled
Is the test actively being monitored.
- Required: No
- Type: bool
- Default:
True
Parameter: enableTelemetry
Enable/Disable usage telemetry for module.
- Required: No
- Type: bool
- Default:
True
Parameter: frequency
Interval in seconds between test runs for this WebTest.
- Required: No
- Type: int
- Default:
300
Parameter: kind
The kind of WebTest that this web test watches.
- Required: No
- Type: string
- Default:
'standard'
- Allowed:
[ 'multistep' 'ping' 'standard' ]
Parameter: location
Location for all Resources.
- Required: No
- Type: string
- Default:
[resourceGroup().location]
Parameter: locations
List of where to physically run the tests from to give global coverage for accessibility of your application.
- Required: No
- Type: array
- Default:
[ { Id: 'us-il-ch1-azr' } { Id: 'us-fl-mia-edge' } { Id: 'latam-br-gru-edge' } { Id: 'apac-sg-sin-azr' } { Id: 'emea-nl-ams-azr' } ]
Parameter: lock
The lock settings of the service.
- Required: No
- Type: object
Optional parameters
Parameter | Type | Description |
---|---|---|
kind |
string | Specify the type of lock. |
name |
string | Specify the name of lock. |
Parameter: lock.kind
Specify the type of lock.
- Required: No
- Type: string
- Allowed:
[ 'CanNotDelete' 'None' 'ReadOnly' ]
Parameter: lock.name
Specify the name of lock.
- Required: No
- Type: string
Parameter: retryEnabled
Allow for retries should this WebTest fail.
- Required: No
- Type: bool
- Default:
True
Parameter: roleAssignments
Array of role assignments to create.
- Required: No
- Type: array
- Roles configurable by name:
'Contributor'
'Owner'
'Reader'
'Role Based Access Control Administrator'
'User Access Administrator'
Required parameters
Parameter | Type | Description |
---|---|---|
principalId |
string | The principal ID of the principal (user/group/identity) to assign the role to. |
roleDefinitionIdOrName |
string | The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. |
Optional parameters
Parameter | Type | Description |
---|---|---|
condition |
string | The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container". |
conditionVersion |
string | Version of the condition. |
delegatedManagedIdentityResourceId |
string | The Resource Id of the delegated managed identity resource. |
description |
string | The description of the role assignment. |
name |
string | The name (as GUID) of the role assignment. If not provided, a GUID will be generated. |
principalType |
string | The principal type of the assigned principal ID. |
Parameter: roleAssignments.principalId
The principal ID of the principal (user/group/identity) to assign the role to.
- Required: Yes
- Type: string
Parameter: roleAssignments.roleDefinitionIdOrName
The role to assign. You can provide either the display name of the role definition, the role definition GUID, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'.
- Required: Yes
- Type: string
Parameter: roleAssignments.condition
The conditions on the role assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase "foo_storage_container".
- Required: No
- Type: string
Parameter: roleAssignments.conditionVersion
Version of the condition.
- Required: No
- Type: string
- Allowed:
[ '2.0' ]
Parameter: roleAssignments.delegatedManagedIdentityResourceId
The Resource Id of the delegated managed identity resource.
- Required: No
- Type: string
Parameter: roleAssignments.description
The description of the role assignment.
- Required: No
- Type: string
Parameter: roleAssignments.name
The name (as GUID) of the role assignment. If not provided, a GUID will be generated.
- Required: No
- Type: string
Parameter: roleAssignments.principalType
The principal type of the assigned principal ID.
- Required: No
- Type: string
- Allowed:
[ 'Device' 'ForeignGroup' 'Group' 'ServicePrincipal' 'User' ]
Parameter: syntheticMonitorId
Unique ID of this WebTest.
- Required: No
- Type: string
- Default:
[parameters('name')]
Parameter: tags
Resource tags. Note: a mandatory tag 'hidden-link' based on the 'appInsightResourceId' parameter will be automatically added to the tags defined here.
- Required: No
- Type: object
Parameter: timeout
Seconds until this WebTest will timeout and fail.
- Required: No
- Type: int
- Default:
30
Parameter: validationRules
The collection of validation rule properties.
- Required: No
- Type: object
- Default:
{}
Outputs
Output | Type | Description |
---|---|---|
location |
string | The location the resource was deployed into. |
name |
string | The name of the webtest. |
resourceGroupName |
string | The resource group the resource was deployed into. |
resourceId |
string | The resource ID of the webtest. |
Cross-referenced modules
This section gives you an overview of all local-referenced module files (i.e., other modules that are referenced in this module) and all remote-referenced files (i.e., Bicep modules that are referenced from a Bicep Registry or Template Specs).
Reference | Type |
---|---|
./packages/utl-common-types/main.bicep |
Local Reference |
Data Collection
The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.
No release notes uploaded for this version
{
"workingFolder": "packages",
"packages": [
// packages defined earlier
{
"name": "avm-bicep/web-tests",
"version": "0.3.1"
}
]
}
Stats
Selected version:
0.3.1
Downloads this version:
0
Downloads all versions:
0
Latest version:
0.3.1
Latest update:
12-02-2025