Creates or updates an Application Insights web test definition.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}?api-version=2022-06-15
URI Parameters
Name |
In |
Required |
Type |
Description |
resourceGroupName
|
path |
True
|
string
|
The name of the resource group. The name is case insensitive.
|
subscriptionId
|
path |
True
|
string
|
The ID of the target subscription.
|
webTestName
|
path |
True
|
string
|
The name of the Application Insights WebTest resource.
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Request Body
Name |
Required |
Type |
Description |
location
|
True
|
string
|
Resource location
|
properties.Kind
|
True
|
WebTestKind
|
The kind of web test this is, valid choices are ping, multistep and standard.
|
properties.Locations
|
True
|
WebTestGeolocation[]
|
A list of where to physically run the tests from to give global coverage for accessibility of your application.
|
properties.Name
|
True
|
string
|
User defined name if this WebTest.
|
properties.SyntheticMonitorId
|
True
|
string
|
Unique ID of this WebTest. This is typically the same value as the Name field.
|
kind
|
|
WebTestKind
|
The kind of WebTest that this web test watches. Choices are ping, multistep and standard.
|
properties.Configuration
|
|
Configuration
|
An XML configuration specification for a WebTest.
|
properties.Description
|
|
string
|
User defined description for this WebTest.
|
properties.Enabled
|
|
boolean
|
Is the test actively being monitored.
|
properties.Frequency
|
|
integer
|
Interval in seconds between test runs for this WebTest. Default value is 300.
|
properties.Request
|
|
Request
|
The collection of request properties
|
properties.RetryEnabled
|
|
boolean
|
Allow for retries should this WebTest fail.
|
properties.Timeout
|
|
integer
|
Seconds until this WebTest will timeout and fail. Default value is 30.
|
properties.ValidationRules
|
|
ValidationRules
|
The collection of validation rule properties
|
tags
|
|
object
|
Resource tags
|
Responses
Name |
Type |
Description |
200 OK
|
WebTest
|
Successfully created or updated an Application Insights web test.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
webTestCreate
Sample request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component?api-version=2022-06-15
{
"location": "South Central US",
"kind": "ping",
"properties": {
"Name": "my-webtest-my-component",
"SyntheticMonitorId": "my-webtest-my-component",
"Configuration": {
"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,
"Timeout": 120,
"Kind": "ping",
"RetryEnabled": true,
"Locations": [
{
"Id": "us-fl-mia-edge"
}
]
}
}
import com.azure.resourcemanager.applicationinsights.models.WebTestGeolocation;
import com.azure.resourcemanager.applicationinsights.models.WebTestKind;
import com.azure.resourcemanager.applicationinsights.models.WebTestPropertiesConfiguration;
import java.util.Arrays;
/**
* Samples for WebTests CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestCreate.
* json
*/
/**
* Sample code: webTestCreate.
*
* @param manager Entry point to ApplicationInsightsManager.
*/
public static void webTestCreate(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
manager.webTests().define("my-webtest-my-component").withRegion("South Central US")
.withExistingResourceGroup("my-resource-group").withKind(WebTestKind.PING)
.withSyntheticMonitorId("my-webtest-my-component").withWebTestName("my-webtest-my-component")
.withDescription("Ping web test alert for mytestwebapp").withEnabled(true).withFrequency(900)
.withTimeout(120).withWebTestKind(WebTestKind.PING).withRetryEnabled(true)
.withLocations(Arrays.asList(new WebTestGeolocation().withLocation("us-fl-mia-edge")))
.withConfiguration(new WebTestPropertiesConfiguration().withWebTest(
"<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>"))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armapplicationinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a0168458930c86636a76bcd7acfdc9c81291bfc/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestCreate.json
func ExampleWebTestsClient_CreateOrUpdate_webTestCreate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewWebTestsClient().CreateOrUpdate(ctx, "my-resource-group", "my-webtest-my-component", armapplicationinsights.WebTest{
Location: to.Ptr("South Central US"),
Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
Properties: &armapplicationinsights.WebTestProperties{
Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
WebTest: to.Ptr("<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: to.Ptr("Ping web test alert for mytestwebapp"),
Enabled: to.Ptr(true),
Frequency: to.Ptr[int32](900),
WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
Locations: []*armapplicationinsights.WebTestGeolocation{
{
Location: to.Ptr("us-fl-mia-edge"),
}},
WebTestName: to.Ptr("my-webtest-my-component"),
RetryEnabled: to.Ptr(true),
SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
Timeout: to.Ptr[int32](120),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.WebTest = armapplicationinsights.WebTest{
// Name: to.Ptr("my-webtest-my-component"),
// Type: to.Ptr("Microsoft.Insights/webtests"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component"),
// Location: to.Ptr("southcentralus"),
// Tags: map[string]*string{
// "hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"),
// },
// Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
// Properties: &armapplicationinsights.WebTestProperties{
// Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
// WebTest: to.Ptr("<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: to.Ptr("Ping web test alert for mytestwebapp"),
// Enabled: to.Ptr(true),
// Frequency: to.Ptr[int32](900),
// WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
// Locations: []*armapplicationinsights.WebTestGeolocation{
// {
// Location: to.Ptr("us-fl-mia-edge"),
// }},
// WebTestName: to.Ptr("my-webtest-my-component"),
// RetryEnabled: to.Ptr(true),
// SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
// Timeout: to.Ptr[int32](120),
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApplicationInsights.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApplicationInsights;
// Generated from example definition: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestCreate.json
// this example is just showing the usage of "WebTests_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "my-resource-group";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApplicationInsightsWebTestResource
ApplicationInsightsWebTestCollection collection = resourceGroupResource.GetApplicationInsightsWebTests();
// invoke the operation
string webTestName = "my-webtest-my-component";
ApplicationInsightsWebTestData data = new ApplicationInsightsWebTestData(new AzureLocation("South Central US"))
{
Kind = WebTestKind.Ping,
SyntheticMonitorId = "my-webtest-my-component",
WebTestName = "my-webtest-my-component",
Description = "Ping web test alert for mytestwebapp",
IsEnabled = true,
FrequencyInSeconds = 900,
TimeoutInSeconds = 120,
WebTestKind = WebTestKind.Ping,
IsRetryEnabled = true,
Locations =
{
new WebTestGeolocation()
{
Location = new AzureLocation("us-fl-mia-edge"),
}
},
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>",
};
ArmOperation<ApplicationInsightsWebTestResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, webTestName, data);
ApplicationInsightsWebTestResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApplicationInsightsWebTestData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component",
"name": "my-webtest-my-component",
"type": "Microsoft.Insights/webtests",
"location": "southcentralus",
"tags": {
"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": "Resource"
},
"kind": "ping",
"properties": {
"Name": "my-webtest-my-component",
"SyntheticMonitorId": "my-webtest-my-component",
"Description": "Ping web test alert for mytestwebapp",
"Enabled": true,
"Frequency": 900,
"Timeout": 120,
"Kind": "ping",
"RetryEnabled": true,
"Locations": [
{
"Id": "us-fl-mia-edge"
}
],
"Configuration": {
"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>"
},
"provisioningState": "Succeeded"
}
}
webTestCreateStandard
Sample request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component?api-version=2022-06-15
{
"location": "South Central US",
"properties": {
"Name": "my-webtest-my-component",
"SyntheticMonitorId": "my-webtest-my-component",
"Description": "Ping web test alert for mytestwebapp",
"Enabled": true,
"Frequency": 900,
"Timeout": 120,
"Kind": "standard",
"RetryEnabled": true,
"Request": {
"RequestUrl": "https://bing.com",
"Headers": [
{
"key": "Content-Language",
"value": "de-DE"
},
{
"key": "Accept-Language",
"value": "de-DE"
}
],
"HttpVerb": "POST",
"RequestBody": "SGVsbG8gd29ybGQ="
},
"ValidationRules": {
"SSLCheck": true,
"SSLCertRemainingLifetimeCheck": 100
},
"Locations": [
{
"Id": "us-fl-mia-edge"
}
]
}
}
import com.azure.resourcemanager.applicationinsights.models.HeaderField;
import com.azure.resourcemanager.applicationinsights.models.WebTestGeolocation;
import com.azure.resourcemanager.applicationinsights.models.WebTestKind;
import com.azure.resourcemanager.applicationinsights.models.WebTestPropertiesRequest;
import com.azure.resourcemanager.applicationinsights.models.WebTestPropertiesValidationRules;
import java.util.Arrays;
/**
* Samples for WebTests CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/
* WebTestCreateStandard.json
*/
/**
* Sample code: webTestCreateStandard.
*
* @param manager Entry point to ApplicationInsightsManager.
*/
public static void
webTestCreateStandard(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
manager.webTests().define("my-webtest-my-component").withRegion("South Central US")
.withExistingResourceGroup("my-resource-group").withSyntheticMonitorId("my-webtest-my-component")
.withWebTestName("my-webtest-my-component").withDescription("Ping web test alert for mytestwebapp")
.withEnabled(true).withFrequency(900).withTimeout(120).withWebTestKind(WebTestKind.STANDARD)
.withRetryEnabled(true)
.withLocations(Arrays.asList(new WebTestGeolocation().withLocation("us-fl-mia-edge")))
.withRequest(new WebTestPropertiesRequest().withRequestUrl("https://bing.com")
.withHeaders(Arrays.asList(
new HeaderField().withHeaderFieldName("fakeTokenPlaceholder").withHeaderFieldValue("de-DE"),
new HeaderField().withHeaderFieldName("fakeTokenPlaceholder").withHeaderFieldValue("de-DE")))
.withHttpVerb("POST").withRequestBody("SGVsbG8gd29ybGQ="))
.withValidationRules(
new WebTestPropertiesValidationRules().withSslCheck(true).withSslCertRemainingLifetimeCheck(100))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armapplicationinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a0168458930c86636a76bcd7acfdc9c81291bfc/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestCreateStandard.json
func ExampleWebTestsClient_CreateOrUpdate_webTestCreateStandard() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewWebTestsClient().CreateOrUpdate(ctx, "my-resource-group", "my-webtest-my-component", armapplicationinsights.WebTest{
Location: to.Ptr("South Central US"),
Properties: &armapplicationinsights.WebTestProperties{
Description: to.Ptr("Ping web test alert for mytestwebapp"),
Enabled: to.Ptr(true),
Frequency: to.Ptr[int32](900),
WebTestKind: to.Ptr(armapplicationinsights.WebTestKindStandard),
Locations: []*armapplicationinsights.WebTestGeolocation{
{
Location: to.Ptr("us-fl-mia-edge"),
}},
WebTestName: to.Ptr("my-webtest-my-component"),
Request: &armapplicationinsights.WebTestPropertiesRequest{
Headers: []*armapplicationinsights.HeaderField{
{
HeaderFieldName: to.Ptr("Content-Language"),
HeaderFieldValue: to.Ptr("de-DE"),
},
{
HeaderFieldName: to.Ptr("Accept-Language"),
HeaderFieldValue: to.Ptr("de-DE"),
}},
HTTPVerb: to.Ptr("POST"),
RequestBody: to.Ptr("SGVsbG8gd29ybGQ="),
RequestURL: to.Ptr("https://bing.com"),
},
RetryEnabled: to.Ptr(true),
SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
Timeout: to.Ptr[int32](120),
ValidationRules: &armapplicationinsights.WebTestPropertiesValidationRules{
SSLCertRemainingLifetimeCheck: to.Ptr[int32](100),
SSLCheck: to.Ptr(true),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.WebTest = armapplicationinsights.WebTest{
// Name: to.Ptr("my-webtest-my-component"),
// Type: to.Ptr("Microsoft.Insights/webtests"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component"),
// Location: to.Ptr("southcentralus"),
// Tags: map[string]*string{
// "hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"),
// },
// Properties: &armapplicationinsights.WebTestProperties{
// Description: to.Ptr("Ping web test alert for mytestwebapp"),
// Enabled: to.Ptr(true),
// Frequency: to.Ptr[int32](900),
// WebTestKind: to.Ptr(armapplicationinsights.WebTestKindStandard),
// Locations: []*armapplicationinsights.WebTestGeolocation{
// {
// Location: to.Ptr("us-fl-mia-edge"),
// }},
// WebTestName: to.Ptr("my-webtest-my-component"),
// Request: &armapplicationinsights.WebTestPropertiesRequest{
// Headers: []*armapplicationinsights.HeaderField{
// {
// HeaderFieldName: to.Ptr("Content-Language"),
// HeaderFieldValue: to.Ptr("de-DE"),
// },
// {
// HeaderFieldName: to.Ptr("Accept-Language"),
// HeaderFieldValue: to.Ptr("de-DE"),
// }},
// HTTPVerb: to.Ptr("POST"),
// RequestBody: to.Ptr("SGVsbG8gd29ybGQ="),
// RequestURL: to.Ptr("https://bing.com"),
// },
// RetryEnabled: to.Ptr(true),
// SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
// Timeout: to.Ptr[int32](120),
// ValidationRules: &armapplicationinsights.WebTestPropertiesValidationRules{
// SSLCertRemainingLifetimeCheck: to.Ptr[int32](100),
// SSLCheck: to.Ptr(true),
// },
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApplicationInsights.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApplicationInsights;
// Generated from example definition: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestCreateStandard.json
// this example is just showing the usage of "WebTests_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "my-resource-group";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApplicationInsightsWebTestResource
ApplicationInsightsWebTestCollection collection = resourceGroupResource.GetApplicationInsightsWebTests();
// invoke the operation
string webTestName = "my-webtest-my-component";
ApplicationInsightsWebTestData data = new ApplicationInsightsWebTestData(new AzureLocation("South Central US"))
{
SyntheticMonitorId = "my-webtest-my-component",
WebTestName = "my-webtest-my-component",
Description = "Ping web test alert for mytestwebapp",
IsEnabled = true,
FrequencyInSeconds = 900,
TimeoutInSeconds = 120,
WebTestKind = WebTestKind.Standard,
IsRetryEnabled = true,
Locations =
{
new WebTestGeolocation()
{
Location = new AzureLocation("us-fl-mia-edge"),
}
},
Request = new WebTestRequest()
{
RequestUri = new Uri("https://bing.com"),
Headers =
{
new WebTestRequestHeaderField()
{
HeaderFieldName = "Content-Language",
HeaderFieldValue = "de-DE",
},new WebTestRequestHeaderField()
{
HeaderFieldName = "Accept-Language",
HeaderFieldValue = "de-DE",
}
},
HttpVerb = "POST",
RequestBody = "SGVsbG8gd29ybGQ=",
},
ValidationRules = new WebTestValidationRules()
{
CheckSsl = true,
SslCertRemainingLifetimeCheck = 100,
},
};
ArmOperation<ApplicationInsightsWebTestResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, webTestName, data);
ApplicationInsightsWebTestResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApplicationInsightsWebTestData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component",
"name": "my-webtest-my-component",
"type": "Microsoft.Insights/webtests",
"location": "southcentralus",
"tags": {
"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": "Resource"
},
"properties": {
"Name": "my-webtest-my-component",
"SyntheticMonitorId": "my-webtest-my-component",
"Description": "Ping web test alert for mytestwebapp",
"Enabled": true,
"Frequency": 900,
"Timeout": 120,
"Kind": "standard",
"RetryEnabled": true,
"Locations": [
{
"Id": "us-fl-mia-edge"
}
],
"Request": {
"RequestUrl": "https://bing.com",
"Headers": [
{
"key": "Content-Language",
"value": "de-DE"
},
{
"key": "Accept-Language",
"value": "de-DE"
}
],
"HttpVerb": "POST",
"RequestBody": "SGVsbG8gd29ybGQ="
},
"ValidationRules": {
"SSLCheck": true,
"SSLCertRemainingLifetimeCheck": 100
},
"provisioningState": "Succeeded"
}
}
webTestUpdate
Sample request
PUT https://management.azure.com/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component?api-version=2022-06-15
{
"location": "South Central US",
"kind": "ping",
"properties": {
"Configuration": {
"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,
"Timeout": 30,
"Locations": [
{
"Id": "us-fl-mia-edge"
},
{
"Id": "apac-hk-hkn-azr"
}
],
"Kind": "ping",
"Name": "my-webtest-my-component",
"SyntheticMonitorId": "my-webtest-my-component"
}
}
import com.azure.resourcemanager.applicationinsights.models.WebTestGeolocation;
import com.azure.resourcemanager.applicationinsights.models.WebTestKind;
import com.azure.resourcemanager.applicationinsights.models.WebTestPropertiesConfiguration;
import java.util.Arrays;
/**
* Samples for WebTests CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestUpdate.
* json
*/
/**
* Sample code: webTestUpdate.
*
* @param manager Entry point to ApplicationInsightsManager.
*/
public static void webTestUpdate(com.azure.resourcemanager.applicationinsights.ApplicationInsightsManager manager) {
manager.webTests().define("my-webtest-my-component").withRegion("South Central US")
.withExistingResourceGroup("my-resource-group").withKind(WebTestKind.PING)
.withSyntheticMonitorId("my-webtest-my-component").withWebTestName("my-webtest-my-component")
.withFrequency(600).withTimeout(30).withWebTestKind(WebTestKind.PING)
.withLocations(Arrays.asList(new WebTestGeolocation().withLocation("us-fl-mia-edge"),
new WebTestGeolocation().withLocation("apac-hk-hkn-azr")))
.withConfiguration(new WebTestPropertiesConfiguration().withWebTest(
"<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>"))
.create();
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armapplicationinsights_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/applicationinsights/armapplicationinsights/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/8a0168458930c86636a76bcd7acfdc9c81291bfc/specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestUpdate.json
func ExampleWebTestsClient_CreateOrUpdate_webTestUpdate() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armapplicationinsights.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewWebTestsClient().CreateOrUpdate(ctx, "my-resource-group", "my-webtest-my-component", armapplicationinsights.WebTest{
Location: to.Ptr("South Central US"),
Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
Properties: &armapplicationinsights.WebTestProperties{
Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
WebTest: to.Ptr("<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: to.Ptr[int32](600),
WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
Locations: []*armapplicationinsights.WebTestGeolocation{
{
Location: to.Ptr("us-fl-mia-edge"),
},
{
Location: to.Ptr("apac-hk-hkn-azr"),
}},
WebTestName: to.Ptr("my-webtest-my-component"),
SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
Timeout: to.Ptr[int32](30),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.WebTest = armapplicationinsights.WebTest{
// Name: to.Ptr("my-webtest-my-component"),
// Type: to.Ptr("Microsoft.Insights/webtests"),
// ID: to.Ptr("/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component"),
// Location: to.Ptr("southcentralus"),
// Tags: map[string]*string{
// "hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": to.Ptr("Resource"),
// },
// Kind: to.Ptr(armapplicationinsights.WebTestKindPing),
// Properties: &armapplicationinsights.WebTestProperties{
// Configuration: &armapplicationinsights.WebTestPropertiesConfiguration{
// WebTest: to.Ptr("<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>"),
// },
// Description: to.Ptr("Ping web test alert for mytestwebapp"),
// Enabled: to.Ptr(true),
// Frequency: to.Ptr[int32](600),
// WebTestKind: to.Ptr(armapplicationinsights.WebTestKindPing),
// Locations: []*armapplicationinsights.WebTestGeolocation{
// {
// Location: to.Ptr("us-fl-mia-edge"),
// },
// {
// Location: to.Ptr("apac-hk-hkn-azr"),
// }},
// WebTestName: to.Ptr("my-webtest-my-component"),
// RetryEnabled: to.Ptr(true),
// SyntheticMonitorID: to.Ptr("my-webtest-my-component"),
// Timeout: to.Ptr[int32](30),
// ProvisioningState: to.Ptr("Succeeded"),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.ApplicationInsights.Models;
using Azure.ResourceManager.Resources;
using Azure.ResourceManager.ApplicationInsights;
// Generated from example definition: specification/applicationinsights/resource-manager/Microsoft.Insights/stable/2022-06-15/examples/WebTestUpdate.json
// this example is just showing the usage of "WebTests_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ResourceGroupResource created on azure
// for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource
string subscriptionId = "subid";
string resourceGroupName = "my-resource-group";
ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
// get the collection of this ApplicationInsightsWebTestResource
ApplicationInsightsWebTestCollection collection = resourceGroupResource.GetApplicationInsightsWebTests();
// invoke the operation
string webTestName = "my-webtest-my-component";
ApplicationInsightsWebTestData data = new ApplicationInsightsWebTestData(new AzureLocation("South Central US"))
{
Kind = WebTestKind.Ping,
SyntheticMonitorId = "my-webtest-my-component",
WebTestName = "my-webtest-my-component",
FrequencyInSeconds = 600,
TimeoutInSeconds = 30,
WebTestKind = WebTestKind.Ping,
Locations =
{
new WebTestGeolocation()
{
Location = new AzureLocation("us-fl-mia-edge"),
},new WebTestGeolocation()
{
Location = new AzureLocation("apac-hk-hkn-azr"),
}
},
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>",
};
ArmOperation<ApplicationInsightsWebTestResource> lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, webTestName, data);
ApplicationInsightsWebTestResource result = lro.Value;
// the variable result is a resource, you could call other operations on this instance as well
// but just for demo, we get its data from this resource instance
ApplicationInsightsWebTestData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample response
{
"id": "/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/webtests/my-webtest-my-component",
"name": "my-webtest-my-component",
"type": "Microsoft.Insights/webtests",
"location": "southcentralus",
"tags": {
"hidden-link:/subscriptions/subid/resourceGroups/my-resource-group/providers/Microsoft.Insights/components/my-component": "Resource"
},
"kind": "ping",
"properties": {
"Name": "my-webtest-my-component",
"SyntheticMonitorId": "my-webtest-my-component",
"Description": "Ping web test alert for mytestwebapp",
"Enabled": true,
"Frequency": 600,
"Timeout": 30,
"Kind": "ping",
"RetryEnabled": true,
"Locations": [
{
"Id": "us-fl-mia-edge"
},
{
"Id": "apac-hk-hkn-azr"
}
],
"Configuration": {
"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>"
},
"provisioningState": "Succeeded"
}
}
Definitions
Name |
Description |
Configuration
|
An XML configuration specification for a WebTest.
|
ContentValidation
|
The collection of content validation properties
|
HeaderField
|
A header to add to the WebTest.
|
Request
|
The collection of request properties
|
ValidationRules
|
The collection of validation rule properties
|
WebTest
|
An Application Insights WebTest definition.
|
WebTestGeolocation
|
Geo-physical location to run a WebTest from. You must specify one or more locations for the test to run from.
|
WebTestKind
|
The kind of WebTest that this web test watches. Choices are ping, multistep and standard.
|
Configuration
Object
An XML configuration specification for a WebTest.
Name |
Type |
Description |
WebTest
|
string
|
The XML specification of a WebTest to run against an application.
|
ContentValidation
Object
The collection of content validation properties
Name |
Type |
Description |
ContentMatch
|
string
|
Content to look for in the return of the WebTest. Must not be null or empty.
|
IgnoreCase
|
boolean
|
When set, this value makes the ContentMatch validation case insensitive.
|
PassIfTextFound
|
boolean
|
When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match
|
Object
A header to add to the WebTest.
Name |
Type |
Description |
key
|
string
|
The name of the header.
|
value
|
string
|
The value of the header.
|
Request
Object
The collection of request properties
Name |
Type |
Description |
FollowRedirects
|
boolean
|
Follow redirects for this web test.
|
Headers
|
HeaderField[]
|
List of headers and their values to add to the WebTest call.
|
HttpVerb
|
string
|
Http verb to use for this web test.
|
ParseDependentRequests
|
boolean
|
Parse Dependent request for this WebTest.
|
RequestBody
|
string
|
Base64 encoded string body to send with this web test.
|
RequestUrl
|
string
|
Url location to test.
|
ValidationRules
Object
The collection of validation rule properties
Name |
Type |
Description |
ContentValidation
|
ContentValidation
|
The collection of content validation properties
|
ExpectedHttpStatusCode
|
integer
|
Validate that the WebTest returns the http status code provided.
|
IgnoreHttpStatusCode
|
boolean
|
When set, validation will ignore the status code.
|
SSLCertRemainingLifetimeCheck
|
integer
|
A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck must be set to true.
|
SSLCheck
|
boolean
|
Checks to see if the SSL cert is still valid.
|
WebTest
Object
An Application Insights WebTest definition.
Name |
Type |
Default value |
Description |
id
|
string
|
|
Azure resource Id
|
kind
|
WebTestKind
|
ping
|
The kind of WebTest that this web test watches. Choices are ping, multistep and standard.
|
location
|
string
|
|
Resource location
|
name
|
string
|
|
Azure resource name
|
properties.Configuration
|
Configuration
|
|
An XML configuration specification for a WebTest.
|
properties.Description
|
string
|
|
User defined description for this WebTest.
|
properties.Enabled
|
boolean
|
|
Is the test actively being monitored.
|
properties.Frequency
|
integer
|
300
|
Interval in seconds between test runs for this WebTest. Default value is 300.
|
properties.Kind
|
WebTestKind
|
ping
|
The kind of web test this is, valid choices are ping, multistep and standard.
|
properties.Locations
|
WebTestGeolocation[]
|
|
A list of where to physically run the tests from to give global coverage for accessibility of your application.
|
properties.Name
|
string
|
|
User defined name if this WebTest.
|
properties.Request
|
Request
|
|
The collection of request properties
|
properties.RetryEnabled
|
boolean
|
|
Allow for retries should this WebTest fail.
|
properties.SyntheticMonitorId
|
string
|
|
Unique ID of this WebTest. This is typically the same value as the Name field.
|
properties.Timeout
|
integer
|
30
|
Seconds until this WebTest will timeout and fail. Default value is 30.
|
properties.ValidationRules
|
ValidationRules
|
|
The collection of validation rule properties
|
properties.provisioningState
|
string
|
|
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.
|
tags
|
object
|
|
Resource tags
|
type
|
string
|
|
Azure resource type
|
WebTestGeolocation
Object
Geo-physical location to run a WebTest from. You must specify one or more locations for the test to run from.
Name |
Type |
Description |
Id
|
string
|
Location ID for the WebTest to run from.
|
WebTestKind
Enumeration
The kind of WebTest that this web test watches. Choices are ping, multistep and standard.
Value |
Description |
multistep
|
|
ping
|
|
standard
|
|