Web Test
An Application Insights web test definition. API Version: 2015-05-01.
Example Usage
webTestCreate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var webTest = new AzureNative.Insights.WebTest("webTest", new()
{
Configuration = new AzureNative.Insights.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.Insights.WebTestKind.Ping,
Location = "South Central US",
Locations = new[]
{
new AzureNative.Insights.Inputs.WebTestGeolocationArgs
{
Location = "us-fl-mia-edge",
},
},
ResourceGroupName = "my-resource-group",
RetryEnabled = true,
SyntheticMonitorId = "my-webtest-my-component",
Timeout = 120,
WebTestKind = AzureNative.Insights.WebTestKind.Ping,
WebTestName = "my-webtest-my-component",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewWebTest(ctx, "webTest", &insights.WebTestArgs{
Configuration: &insights.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: insights.WebTestKindPing,
Location: pulumi.String("South Central US"),
Locations: []insights.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: insights.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.insights.WebTest;
import com.pulumi.azurenative.insights.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 webTest = new WebTest("webTest", WebTestArgs.builder()
.configuration(Map.of("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("ping")
.location("South Central US")
.locations(Map.of("location", "us-fl-mia-edge"))
.resourceGroupName("my-resource-group")
.retryEnabled(true)
.syntheticMonitorId("my-webtest-my-component")
.timeout(120)
.webTestKind("ping")
.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.Insights.WebTest("webTest", new()
{
Configuration = new AzureNative.Insights.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.Insights.WebTestKind.Ping,
Location = "South Central US",
Locations = new[]
{
new AzureNative.Insights.Inputs.WebTestGeolocationArgs
{
Location = "us-fl-mia-edge",
},
new AzureNative.Insights.Inputs.WebTestGeolocationArgs
{
Location = "apac-hk-hkn-azr",
},
},
ResourceGroupName = "my-resource-group",
SyntheticMonitorId = "my-webtest-my-component",
Timeout = 30,
WebTestKind = AzureNative.Insights.WebTestKind.Ping,
WebTestName = "my-webtest-my-component",
});
});
package main
import (
insights "github.com/pulumi/pulumi-azure-native-sdk/insights"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := insights.NewWebTest(ctx, "webTest", &insights.WebTestArgs{
Configuration: &insights.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: insights.WebTestKindPing,
Location: pulumi.String("South Central US"),
Locations: []insights.WebTestGeolocationArgs{
{
Location: pulumi.String("us-fl-mia-edge"),
},
{
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: insights.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.insights.WebTest;
import com.pulumi.azurenative.insights.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 webTest = new WebTest("webTest", WebTestArgs.builder()
.configuration(Map.of("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("ping")
.location("South Central US")
.locations(
Map.of("location", "us-fl-mia-edge"),
Map.of("location", "apac-hk-hkn-azr"))
.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:insights:WebTest my-webtest-my-component /subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component
Properties
An XML configuration specification for a WebTest.
Purpose/user defined descriptive test for this WebTest.
A list of where to physically run the tests from to give global coverage for accessibility of your application.
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.
Allow for retries should this WebTest fail.
Unique ID of this WebTest. This is typically the same value as the Name field.
The kind of web test this is, valid choices are ping and multistep.
User defined name if this WebTest.