WebTest

class WebTest : KotlinCustomResource

Manages an Application Insights WebTest.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "tf-test",
location: "West Europe",
});
const exampleInsights = new azure.appinsights.Insights("example", {
name: "tf-test-appinsights",
location: example.location,
resourceGroupName: example.name,
applicationType: "web",
});
const exampleWebTest = new azure.appinsights.WebTest("example", {
name: "tf-test-appinsights-webtest",
location: exampleInsights.location,
resourceGroupName: example.name,
applicationInsightsId: exampleInsights.id,
kind: "ping",
frequency: 300,
timeout: 60,
enabled: true,
geoLocations: [
"us-tx-sn1-azr",
"us-il-ch1-azr",
],
configuration: `<WebTest Name="WebTest1" Id="ABD48585-0831-40CB-9069-682EA6BB3583" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" 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="a5f10126-e4cd-570d-961c-cea43999a200" Version="1.1" Url="http://microsoft.com" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="200" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
</Items>
</WebTest>
`,
});
export const webtestId = exampleWebTest.id;
export const webtestsSyntheticId = exampleWebTest.syntheticMonitorId;
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="tf-test",
location="West Europe")
example_insights = azure.appinsights.Insights("example",
name="tf-test-appinsights",
location=example.location,
resource_group_name=example.name,
application_type="web")
example_web_test = azure.appinsights.WebTest("example",
name="tf-test-appinsights-webtest",
location=example_insights.location,
resource_group_name=example.name,
application_insights_id=example_insights.id,
kind="ping",
frequency=300,
timeout=60,
enabled=True,
geo_locations=[
"us-tx-sn1-azr",
"us-il-ch1-azr",
],
configuration="""<WebTest Name="WebTest1" Id="ABD48585-0831-40CB-9069-682EA6BB3583" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" 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="a5f10126-e4cd-570d-961c-cea43999a200" Version="1.1" Url="http://microsoft.com" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="200" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
</Items>
</WebTest>
""")
pulumi.export("webtestId", example_web_test.id)
pulumi.export("webtestsSyntheticId", example_web_test.synthetic_monitor_id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "tf-test",
Location = "West Europe",
});
var exampleInsights = new Azure.AppInsights.Insights("example", new()
{
Name = "tf-test-appinsights",
Location = example.Location,
ResourceGroupName = example.Name,
ApplicationType = "web",
});
var exampleWebTest = new Azure.AppInsights.WebTest("example", new()
{
Name = "tf-test-appinsights-webtest",
Location = exampleInsights.Location,
ResourceGroupName = example.Name,
ApplicationInsightsId = exampleInsights.Id,
Kind = "ping",
Frequency = 300,
Timeout = 60,
Enabled = true,
GeoLocations = new[]
{
"us-tx-sn1-azr",
"us-il-ch1-azr",
},
Configuration = @"<WebTest Name=""WebTest1"" Id=""ABD48585-0831-40CB-9069-682EA6BB3583"" Enabled=""True"" CssProjectStructure="""" CssIteration="""" Timeout=""0"" 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=""a5f10126-e4cd-570d-961c-cea43999a200"" Version=""1.1"" Url=""http://microsoft.com"" ThinkTime=""0"" Timeout=""300"" ParseDependentRequests=""True"" FollowRedirects=""True"" RecordResult=""True"" Cache=""False"" ResponseTimeGoal=""0"" Encoding=""utf-8"" ExpectedHttpStatusCode=""200"" ExpectedResponseUrl="""" ReportingName="""" IgnoreHttpStatusCode=""False"" />
</Items>
</WebTest>
",
});
return new Dictionary<string, object?>
{
["webtestId"] = exampleWebTest.Id,
["webtestsSyntheticId"] = exampleWebTest.SyntheticMonitorId,
};
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/appinsights"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("tf-test"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleInsights, err := appinsights.NewInsights(ctx, "example", &appinsights.InsightsArgs{
Name: pulumi.String("tf-test-appinsights"),
Location: example.Location,
ResourceGroupName: example.Name,
ApplicationType: pulumi.String("web"),
})
if err != nil {
return err
}
exampleWebTest, err := appinsights.NewWebTest(ctx, "example", &appinsights.WebTestArgs{
Name: pulumi.String("tf-test-appinsights-webtest"),
Location: exampleInsights.Location,
ResourceGroupName: example.Name,
ApplicationInsightsId: exampleInsights.ID(),
Kind: pulumi.String("ping"),
Frequency: pulumi.Int(300),
Timeout: pulumi.Int(60),
Enabled: pulumi.Bool(true),
GeoLocations: pulumi.StringArray{
pulumi.String("us-tx-sn1-azr"),
pulumi.String("us-il-ch1-azr"),
},
Configuration: pulumi.String(`<WebTest Name="WebTest1" Id="ABD48585-0831-40CB-9069-682EA6BB3583" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" 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="a5f10126-e4cd-570d-961c-cea43999a200" Version="1.1" Url="http://microsoft.com" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="200" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
</Items>
</WebTest>
`),
})
if err != nil {
return err
}
ctx.Export("webtestId", exampleWebTest.ID())
ctx.Export("webtestsSyntheticId", exampleWebTest.SyntheticMonitorId)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.appinsights.Insights;
import com.pulumi.azure.appinsights.InsightsArgs;
import com.pulumi.azure.appinsights.WebTest;
import com.pulumi.azure.appinsights.WebTestArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("tf-test")
.location("West Europe")
.build());
var exampleInsights = new Insights("exampleInsights", InsightsArgs.builder()
.name("tf-test-appinsights")
.location(example.location())
.resourceGroupName(example.name())
.applicationType("web")
.build());
var exampleWebTest = new WebTest("exampleWebTest", WebTestArgs.builder()
.name("tf-test-appinsights-webtest")
.location(exampleInsights.location())
.resourceGroupName(example.name())
.applicationInsightsId(exampleInsights.id())
.kind("ping")
.frequency(300)
.timeout(60)
.enabled(true)
.geoLocations(
"us-tx-sn1-azr",
"us-il-ch1-azr")
.configuration("""
<WebTest Name="WebTest1" Id="ABD48585-0831-40CB-9069-682EA6BB3583" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" 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="a5f10126-e4cd-570d-961c-cea43999a200" Version="1.1" Url="http://microsoft.com" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="200" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
</Items>
</WebTest>
""")
.build());
ctx.export("webtestId", exampleWebTest.id());
ctx.export("webtestsSyntheticId", exampleWebTest.syntheticMonitorId());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: tf-test
location: West Europe
exampleInsights:
type: azure:appinsights:Insights
name: example
properties:
name: tf-test-appinsights
location: ${example.location}
resourceGroupName: ${example.name}
applicationType: web
exampleWebTest:
type: azure:appinsights:WebTest
name: example
properties:
name: tf-test-appinsights-webtest
location: ${exampleInsights.location}
resourceGroupName: ${example.name}
applicationInsightsId: ${exampleInsights.id}
kind: ping
frequency: 300
timeout: 60
enabled: true
geoLocations:
- us-tx-sn1-azr
- us-il-ch1-azr
configuration: |
<WebTest Name="WebTest1" Id="ABD48585-0831-40CB-9069-682EA6BB3583" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="0" 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="a5f10126-e4cd-570d-961c-cea43999a200" Version="1.1" Url="http://microsoft.com" ThinkTime="0" Timeout="300" ParseDependentRequests="True" FollowRedirects="True" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="200" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
</Items>
</WebTest>
outputs:
webtestId: ${exampleWebTest.id}
webtestsSyntheticId: ${exampleWebTest.syntheticMonitorId}

API Providers

This resource uses the following Azure API Providers:

  • Microsoft.Insights: 2022-06-15

Import

Application Insights Web Tests can be imported using the resource id, e.g.

$ pulumi import azure:appinsights/webTest:WebTest my_test /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Insights/webTests/my_test

Properties

Link copied to clipboard

The ID of the Application Insights component on which the WebTest operates. Changing this forces a new resource to be created.

Link copied to clipboard
val configuration: Output<String>

An XML configuration specification for a WebTest (see here for more information).

Link copied to clipboard
val description: Output<String>?

Purpose/user defined descriptive test for this WebTest.

Link copied to clipboard
val enabled: Output<Boolean>?

Is the test actively being monitored.

Link copied to clipboard
val frequency: Output<Int>?

Interval in seconds between test runs for this WebTest. Valid options are 300, 600 and 900. Defaults to 300.

Link copied to clipboard
val geoLocations: Output<List<String>>

A list of where to physically run the tests from to give global coverage for accessibility of your application.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val kind: Output<String>

The kind of web test that this web test watches. Choices are ping and multistep. Changing this forces a new resource to be created.

Link copied to clipboard
val location: Output<String>

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. It needs to correlate with location of parent resource (azurerm_application_insights).

Link copied to clipboard
val name: Output<String>

Specifies the name of the Application Insights WebTest. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the resource group in which to create the Application Insights WebTest. Changing this forces a new resource

Link copied to clipboard
val retryEnabled: Output<Boolean>?

Allow for retries should this WebTest fail.

Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val timeout: Output<Int>?

Seconds until this WebTest will timeout and fail. Default is 30.

Link copied to clipboard
val urn: Output<String>