WebTest

class WebTest : KotlinCustomResource

An Application Insights WebTest definition. Uses Azure REST API version 2022-06-15. Other available API versions: 2015-05-01, 2018-05-01-preview, 2020-10-05-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native applicationinsights [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

webTestCreate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var webTest = new AzureNative.ApplicationInsights.WebTest("webTest", new()
{
Configuration = new AzureNative.ApplicationInsights.Inputs.WebTestPropertiesConfigurationArgs
{
WebTest = "<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" 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=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>",
},
Description = "Ping web test alert for mytestwebapp",
Enabled = true,
Frequency = 900,
Kind = AzureNative.ApplicationInsights.WebTestKind.Ping,
Location = "South Central US",
Locations = new[]
{
new AzureNative.ApplicationInsights.Inputs.WebTestGeolocationArgs
{
Location = "us-fl-mia-edge",
},
},
ResourceGroupName = "my-resource-group",
RetryEnabled = true,
SyntheticMonitorId = "my-webtest-my-component",
Timeout = 120,
WebTestKind = AzureNative.ApplicationInsights.WebTestKind.Ping,
WebTestName = "my-webtest-my-component",
});
});
package main
import (
applicationinsights "github.com/pulumi/pulumi-azure-native-sdk/applicationinsights/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := applicationinsights.NewWebTest(ctx, "webTest", &applicationinsights.WebTestArgs{
Configuration: &applicationinsights.WebTestPropertiesConfigurationArgs{
WebTest: pulumi.String("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" 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=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
},
Description: pulumi.String("Ping web test alert for mytestwebapp"),
Enabled: pulumi.Bool(true),
Frequency: pulumi.Int(900),
Kind: applicationinsights.WebTestKindPing,
Location: pulumi.String("South Central US"),
Locations: applicationinsights.WebTestGeolocationArray{
&applicationinsights.WebTestGeolocationArgs{
Location: pulumi.String("us-fl-mia-edge"),
},
},
ResourceGroupName: pulumi.String("my-resource-group"),
RetryEnabled: pulumi.Bool(true),
SyntheticMonitorId: pulumi.String("my-webtest-my-component"),
Timeout: pulumi.Int(120),
WebTestKind: applicationinsights.WebTestKindPing,
WebTestName: pulumi.String("my-webtest-my-component"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.applicationinsights.WebTest;
import com.pulumi.azurenative.applicationinsights.WebTestArgs;
import com.pulumi.azurenative.applicationinsights.inputs.WebTestPropertiesConfigurationArgs;
import com.pulumi.azurenative.applicationinsights.inputs.WebTestGeolocationArgs;
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 webTest = new WebTest("webTest", WebTestArgs.builder()
.configuration(WebTestPropertiesConfigurationArgs.builder()
.webTest("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"120\" 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=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"120\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>")
.build())
.description("Ping web test alert for mytestwebapp")
.enabled(true)
.frequency(900)
.kind("ping")
.location("South Central US")
.locations(WebTestGeolocationArgs.builder()
.location("us-fl-mia-edge")
.build())
.resourceGroupName("my-resource-group")
.retryEnabled(true)
.syntheticMonitorId("my-webtest-my-component")
.timeout(120)
.webTestKind("ping")
.webTestName("my-webtest-my-component")
.build());
}
}

webTestCreateStandard

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var webTest = new AzureNative.ApplicationInsights.WebTest("webTest", new()
{
Description = "Ping web test alert for mytestwebapp",
Enabled = true,
Frequency = 900,
Location = "South Central US",
Locations = new[]
{
new AzureNative.ApplicationInsights.Inputs.WebTestGeolocationArgs
{
Location = "us-fl-mia-edge",
},
},
Request = new AzureNative.ApplicationInsights.Inputs.WebTestPropertiesRequestArgs
{
Headers = new[]
{
new AzureNative.ApplicationInsights.Inputs.HeaderFieldArgs
{
HeaderFieldName = "Content-Language",
HeaderFieldValue = "de-DE",
},
new AzureNative.ApplicationInsights.Inputs.HeaderFieldArgs
{
HeaderFieldName = "Accept-Language",
HeaderFieldValue = "de-DE",
},
},
HttpVerb = "POST",
RequestBody = "SGVsbG8gd29ybGQ=",
RequestUrl = "https://bing.com",
},
ResourceGroupName = "my-resource-group",
RetryEnabled = true,
SyntheticMonitorId = "my-webtest-my-component",
Timeout = 120,
ValidationRules = new AzureNative.ApplicationInsights.Inputs.WebTestPropertiesValidationRulesArgs
{
SSLCertRemainingLifetimeCheck = 100,
SSLCheck = true,
},
WebTestKind = AzureNative.ApplicationInsights.WebTestKind.Standard,
WebTestName = "my-webtest-my-component",
});
});
package main
import (
applicationinsights "github.com/pulumi/pulumi-azure-native-sdk/applicationinsights/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := applicationinsights.NewWebTest(ctx, "webTest", &applicationinsights.WebTestArgs{
Description: pulumi.String("Ping web test alert for mytestwebapp"),
Enabled: pulumi.Bool(true),
Frequency: pulumi.Int(900),
Location: pulumi.String("South Central US"),
Locations: applicationinsights.WebTestGeolocationArray{
&applicationinsights.WebTestGeolocationArgs{
Location: pulumi.String("us-fl-mia-edge"),
},
},
Request: &applicationinsights.WebTestPropertiesRequestArgs{
Headers: applicationinsights.HeaderFieldArray{
&applicationinsights.HeaderFieldArgs{
HeaderFieldName: pulumi.String("Content-Language"),
HeaderFieldValue: pulumi.String("de-DE"),
},
&applicationinsights.HeaderFieldArgs{
HeaderFieldName: pulumi.String("Accept-Language"),
HeaderFieldValue: pulumi.String("de-DE"),
},
},
HttpVerb: pulumi.String("POST"),
RequestBody: pulumi.String("SGVsbG8gd29ybGQ="),
RequestUrl: pulumi.String("https://bing.com"),
},
ResourceGroupName: pulumi.String("my-resource-group"),
RetryEnabled: pulumi.Bool(true),
SyntheticMonitorId: pulumi.String("my-webtest-my-component"),
Timeout: pulumi.Int(120),
ValidationRules: &applicationinsights.WebTestPropertiesValidationRulesArgs{
SSLCertRemainingLifetimeCheck: pulumi.Int(100),
SSLCheck: pulumi.Bool(true),
},
WebTestKind: applicationinsights.WebTestKindStandard,
WebTestName: pulumi.String("my-webtest-my-component"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.applicationinsights.WebTest;
import com.pulumi.azurenative.applicationinsights.WebTestArgs;
import com.pulumi.azurenative.applicationinsights.inputs.WebTestGeolocationArgs;
import com.pulumi.azurenative.applicationinsights.inputs.WebTestPropertiesRequestArgs;
import com.pulumi.azurenative.applicationinsights.inputs.WebTestPropertiesValidationRulesArgs;
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 webTest = new WebTest("webTest", WebTestArgs.builder()
.description("Ping web test alert for mytestwebapp")
.enabled(true)
.frequency(900)
.location("South Central US")
.locations(WebTestGeolocationArgs.builder()
.location("us-fl-mia-edge")
.build())
.request(WebTestPropertiesRequestArgs.builder()
.headers(
HeaderFieldArgs.builder()
.headerFieldName("Content-Language")
.headerFieldValue("de-DE")
.build(),
HeaderFieldArgs.builder()
.headerFieldName("Accept-Language")
.headerFieldValue("de-DE")
.build())
.httpVerb("POST")
.requestBody("SGVsbG8gd29ybGQ=")
.requestUrl("https://bing.com")
.build())
.resourceGroupName("my-resource-group")
.retryEnabled(true)
.syntheticMonitorId("my-webtest-my-component")
.timeout(120)
.validationRules(WebTestPropertiesValidationRulesArgs.builder()
.sSLCertRemainingLifetimeCheck(100)
.sSLCheck(true)
.build())
.webTestKind("standard")
.webTestName("my-webtest-my-component")
.build());
}
}

webTestUpdate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var webTest = new AzureNative.ApplicationInsights.WebTest("webTest", new()
{
Configuration = new AzureNative.ApplicationInsights.Inputs.WebTestPropertiesConfigurationArgs
{
WebTest = "<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"30\" 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=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"30\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>",
},
Frequency = 600,
Kind = AzureNative.ApplicationInsights.WebTestKind.Ping,
Location = "South Central US",
Locations = new[]
{
new AzureNative.ApplicationInsights.Inputs.WebTestGeolocationArgs
{
Location = "us-fl-mia-edge",
},
new AzureNative.ApplicationInsights.Inputs.WebTestGeolocationArgs
{
Location = "apac-hk-hkn-azr",
},
},
ResourceGroupName = "my-resource-group",
SyntheticMonitorId = "my-webtest-my-component",
Timeout = 30,
WebTestKind = AzureNative.ApplicationInsights.WebTestKind.Ping,
WebTestName = "my-webtest-my-component",
});
});
package main
import (
applicationinsights "github.com/pulumi/pulumi-azure-native-sdk/applicationinsights/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := applicationinsights.NewWebTest(ctx, "webTest", &applicationinsights.WebTestArgs{
Configuration: &applicationinsights.WebTestPropertiesConfigurationArgs{
WebTest: pulumi.String("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"30\" 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=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"30\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>"),
},
Frequency: pulumi.Int(600),
Kind: applicationinsights.WebTestKindPing,
Location: pulumi.String("South Central US"),
Locations: applicationinsights.WebTestGeolocationArray{
&applicationinsights.WebTestGeolocationArgs{
Location: pulumi.String("us-fl-mia-edge"),
},
&applicationinsights.WebTestGeolocationArgs{
Location: pulumi.String("apac-hk-hkn-azr"),
},
},
ResourceGroupName: pulumi.String("my-resource-group"),
SyntheticMonitorId: pulumi.String("my-webtest-my-component"),
Timeout: pulumi.Int(30),
WebTestKind: applicationinsights.WebTestKindPing,
WebTestName: pulumi.String("my-webtest-my-component"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.applicationinsights.WebTest;
import com.pulumi.azurenative.applicationinsights.WebTestArgs;
import com.pulumi.azurenative.applicationinsights.inputs.WebTestPropertiesConfigurationArgs;
import com.pulumi.azurenative.applicationinsights.inputs.WebTestGeolocationArgs;
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 webTest = new WebTest("webTest", WebTestArgs.builder()
.configuration(WebTestPropertiesConfigurationArgs.builder()
.webTest("<WebTest Name=\"my-webtest\" Id=\"678ddf96-1ab8-44c8-9274-123456789abc\" Enabled=\"True\" CssProjectStructure=\"\" CssIteration=\"\" Timeout=\"30\" 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=\"a4162485-9114-fcfc-e086-123456789abc\" Version=\"1.1\" Url=\"http://my-component.azurewebsites.net\" ThinkTime=\"0\" Timeout=\"30\" ParseDependentRequests=\"True\" FollowRedirects=\"True\" RecordResult=\"True\" Cache=\"False\" ResponseTimeGoal=\"0\" Encoding=\"utf-8\" ExpectedHttpStatusCode=\"200\" ExpectedResponseUrl=\"\" ReportingName=\"\" IgnoreHttpStatusCode=\"False\" /></Items></WebTest>")
.build())
.frequency(600)
.kind("ping")
.location("South Central US")
.locations(
WebTestGeolocationArgs.builder()
.location("us-fl-mia-edge")
.build(),
WebTestGeolocationArgs.builder()
.location("apac-hk-hkn-azr")
.build())
.resourceGroupName("my-resource-group")
.syntheticMonitorId("my-webtest-my-component")
.timeout(30)
.webTestKind("ping")
.webTestName("my-webtest-my-component")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:applicationinsights:WebTest my-webtest-my-component /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}

Properties

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard

An XML configuration specification for a WebTest.

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

User defined description 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. Default value is 300.

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

The kind of WebTest that this web test watches. Choices are ping, multistep and standard.

Link copied to clipboard
val location: Output<String>

Resource location

Link copied to clipboard

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

Link copied to clipboard
val name: Output<String>

Azure resource name

Link copied to clipboard

Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.

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

The collection of request properties

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

Allow for retries should this WebTest fail.

Link copied to clipboard

Unique ID of this WebTest. This is typically the same value as the Name field.

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

Resource tags

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

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

Link copied to clipboard
val type: Output<String>

Azure resource type

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

The collection of validation rule properties

Link copied to clipboard
val webTestKind: Output<String>

The kind of web test this is, valid choices are ping, multistep and standard.

Link copied to clipboard
val webTestName: Output<String>

User defined name if this WebTest.