WebTestArgs

data class WebTestArgs(val configuration: Output<WebTestPropertiesConfigurationArgs>? = null, val description: Output<String>? = null, val enabled: Output<Boolean>? = null, val frequency: Output<Int>? = null, val kind: Output<WebTestKind>? = null, val location: Output<String>? = null, val locations: Output<List<WebTestGeolocationArgs>>? = null, val request: Output<WebTestPropertiesRequestArgs>? = null, val resourceGroupName: Output<String>? = null, val retryEnabled: Output<Boolean>? = null, val syntheticMonitorId: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val timeout: Output<Int>? = null, val validationRules: Output<WebTestPropertiesValidationRulesArgs>? = null, val webTestKind: Output<WebTestKind>? = null, val webTestName: Output<String>? = null) : ConvertibleToJava<WebTestArgs>

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}

Constructors

Link copied to clipboard
constructor(configuration: Output<WebTestPropertiesConfigurationArgs>? = null, description: Output<String>? = null, enabled: Output<Boolean>? = null, frequency: Output<Int>? = null, kind: Output<WebTestKind>? = null, location: Output<String>? = null, locations: Output<List<WebTestGeolocationArgs>>? = null, request: Output<WebTestPropertiesRequestArgs>? = null, resourceGroupName: Output<String>? = null, retryEnabled: Output<Boolean>? = null, syntheticMonitorId: Output<String>? = null, tags: Output<Map<String, String>>? = null, timeout: Output<Int>? = null, validationRules: Output<WebTestPropertiesValidationRulesArgs>? = null, webTestKind: Output<WebTestKind>? = null, webTestName: Output<String>? = null)

Properties

Link copied to clipboard

An XML configuration specification for a WebTest.

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

User defined description for this WebTest.

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

Is the test actively being monitored.

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

Interval in seconds between test runs for this WebTest. Default value is 300.

Link copied to clipboard
val kind: Output<WebTestKind>? = null

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

Link copied to clipboard
val location: Output<String>? = null

Resource location

Link copied to clipboard
val locations: Output<List<WebTestGeolocationArgs>>? = null

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

Link copied to clipboard

The collection of request properties

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

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

Allow for retries should this WebTest fail.

Link copied to clipboard
val syntheticMonitorId: Output<String>? = null

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>>? = null

Resource tags

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

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

Link copied to clipboard

The collection of validation rule properties

Link copied to clipboard
val webTestKind: Output<WebTestKind>? = null

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

Link copied to clipboard
val webTestName: Output<String>? = null

User defined name if this WebTest.

Functions

Link copied to clipboard
open override fun toJava(): WebTestArgs