Создает или обновляет определение веб-теста Application Insights.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}?api-version=2022-06-15
Параметры URI
Имя |
В |
Обязательно |
Тип |
Описание |
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Имя группы ресурсов. Имя не учитывает регистр.
|
subscriptionId
|
path |
True
|
string
minLength: 1
|
Идентификатор целевой подписки.
|
webTestName
|
path |
True
|
string
|
Имя ресурса WebTest Application Insights.
|
api-version
|
query |
True
|
string
minLength: 1
|
Версия API, используемая для этой операции.
|
Текст запроса
Имя |
Обязательно |
Тип |
Описание |
location
|
True
|
string
|
Расположение ресурса
|
properties.Kind
|
True
|
WebTestKind
|
Тип веб-теста это, допустимые варианты: ping, multistep и standard.
|
properties.Locations
|
True
|
WebTestGeolocation[]
|
Список мест, где физически выполнять тесты, чтобы предоставить глобальное покрытие для специальных возможностей вашего приложения.
|
properties.Name
|
True
|
string
|
Определяемое пользователем имя, если этот WebTest.
|
properties.SyntheticMonitorId
|
True
|
string
|
Уникальный идентификатор этого веб-теста. Обычно это значение совпадает с полем "Имя".
|
kind
|
|
WebTestKind
|
Тип WebTest, который просматривает этот веб-тест. Выбор — это связь, многоэтапная и стандартная.
|
properties.Configuration
|
|
Configuration
|
Спецификация конфигурации XML для WebTest.
|
properties.Description
|
|
string
|
Определяемое пользователем описание этого webTest.
|
properties.Enabled
|
|
boolean
|
Выполняется активное наблюдение за тестом.
|
properties.Frequency
|
|
integer
(int32)
|
Интервал в секундах между выполнением тестов для этого webTest. Значение по умолчанию — 300.
|
properties.Request
|
|
Request
|
Коллекция свойств запроса
|
properties.RetryEnabled
|
|
boolean
|
Разрешить повторные попытки в случае сбоя WebTest.
|
properties.Timeout
|
|
integer
(int32)
|
Секунды, пока этот веб-тест не завершится временем ожидания и завершится сбоем. Значение по умолчанию — 30.
|
properties.ValidationRules
|
|
ValidationRules
|
Коллекция свойств правила проверки
|
tags
|
|
object
|
Теги ресурсов
|
Ответы
Имя |
Тип |
Описание |
200 OK
|
WebTest
|
Успешно создан или обновлен веб-тест Application Insights.
|
Безопасность
azure_auth
Поток OAuth2 Azure Active Directory.
Тип:
oauth2
Flow:
implicit
URL-адрес авторизации:
https://login.microsoftonline.com/common/oauth2/authorize
Области
Имя |
Описание |
user_impersonation
|
олицетворения учетной записи пользователя
|
Примеры
webTestCreate
Образец запроса
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
Пример ответа
{
"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
Образец запроса
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
Пример ответа
{
"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
Образец запроса
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
Пример ответа
{
"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"
}
}
Определения
Имя |
Описание |
Configuration
|
Спецификация конфигурации XML для WebTest.
|
ContentValidation
|
Коллекция свойств проверки содержимого
|
HeaderField
|
Заголовок, добавляемый в WebTest.
|
Request
|
Коллекция свойств запроса
|
ValidationRules
|
Коллекция свойств правила проверки
|
WebTest
|
Определение WebTest Application Insights.
|
WebTestGeolocation
|
Гео физическое расположение для запуска WebTest из. Для запуска теста необходимо указать одно или несколько расположений.
|
WebTestKind
|
Тип WebTest, который просматривает этот веб-тест. Выбор — это связь, многоэтапная и стандартная.
|
Configuration
Object
Спецификация конфигурации XML для WebTest.
Имя |
Тип |
Описание |
WebTest
|
string
|
Спецификация XML веб-теста для запуска в приложении.
|
ContentValidation
Object
Коллекция свойств проверки содержимого
Имя |
Тип |
Описание |
ContentMatch
|
string
|
Содержимое для поиска в возврате WebTest. Не должно быть пустым или пустым.
|
IgnoreCase
|
boolean
|
Если задано, это значение не учитывает регистр проверки ContentMatch.
|
PassIfTextFound
|
boolean
|
Если значение true, проверка будет проходить, если для строки ContentMatch имеется совпадение. Если значение false, проверка завершится ошибкой при наличии совпадения
|
Object
Заголовок, добавляемый в WebTest.
Имя |
Тип |
Описание |
key
|
string
|
Имя заголовка.
|
value
|
string
|
Значение заголовка.
|
Request
Object
Коллекция свойств запроса
Имя |
Тип |
Описание |
FollowRedirects
|
boolean
|
Следуйте перенаправлениям для этого веб-теста.
|
Headers
|
HeaderField[]
|
Список заголовков и их значений для добавления в вызов WebTest.
|
HttpVerb
|
string
|
Http-команда, используемая для этого веб-теста.
|
ParseDependentRequests
|
boolean
|
Анализ зависимого запроса для этого webTest.
|
RequestBody
|
string
|
Текст строки в кодировке Base64 для отправки с помощью этого веб-теста.
|
RequestUrl
|
string
|
Расположение URL-адреса для тестирования.
|
ValidationRules
Object
Коллекция свойств правила проверки
Имя |
Тип |
Описание |
ContentValidation
|
ContentValidation
|
Коллекция свойств проверки содержимого
|
ExpectedHttpStatusCode
|
integer
(int32)
|
Убедитесь, что WebTest возвращает предоставленный код состояния HTTP.
|
IgnoreHttpStatusCode
|
boolean
|
При установке проверка будет игнорировать код состояния.
|
SSLCertRemainingLifetimeCheck
|
integer
(int32)
|
Количество дней для проверки по-прежнему остается до истечения срока действия существующего SSL-сертификата. Значение должно быть положительным, а sslcheck должно иметь значение true.
|
SSLCheck
|
boolean
|
Проверяет, является ли SSL-сертификат допустимым.
|
WebTest
Object
Определение WebTest Application Insights.
Имя |
Тип |
Default value |
Описание |
id
|
string
|
|
Идентификатор ресурса Azure
|
kind
|
WebTestKind
|
ping
|
Тип WebTest, который просматривает этот веб-тест. Выбор — это связь, многоэтапная и стандартная.
|
location
|
string
|
|
Расположение ресурса
|
name
|
string
|
|
Имя ресурса Azure
|
properties.Configuration
|
Configuration
|
|
Спецификация конфигурации XML для WebTest.
|
properties.Description
|
string
|
|
Определяемое пользователем описание этого webTest.
|
properties.Enabled
|
boolean
|
|
Выполняется активное наблюдение за тестом.
|
properties.Frequency
|
integer
(int32)
|
300
|
Интервал в секундах между выполнением тестов для этого webTest. Значение по умолчанию — 300.
|
properties.Kind
|
WebTestKind
|
ping
|
Тип веб-теста это, допустимые варианты: ping, multistep и standard.
|
properties.Locations
|
WebTestGeolocation[]
|
|
Список мест, где физически выполнять тесты, чтобы предоставить глобальное покрытие для специальных возможностей вашего приложения.
|
properties.Name
|
string
|
|
Определяемое пользователем имя, если этот WebTest.
|
properties.Request
|
Request
|
|
Коллекция свойств запроса
|
properties.RetryEnabled
|
boolean
|
|
Разрешить повторные попытки в случае сбоя WebTest.
|
properties.SyntheticMonitorId
|
string
|
|
Уникальный идентификатор этого веб-теста. Обычно это значение совпадает с полем "Имя".
|
properties.Timeout
|
integer
(int32)
|
30
|
Секунды, пока этот веб-тест не завершится временем ожидания и завершится сбоем. Значение по умолчанию — 30.
|
properties.ValidationRules
|
ValidationRules
|
|
Коллекция свойств правила проверки
|
properties.provisioningState
|
string
|
|
Текущее состояние этого компонента, подготовлено ли оно в группе ресурсов. Пользователи не могут изменить это значение, но могут прочитать его. К значениям относятся успешное выполнение, развертывание, отмена и сбой.
|
tags
|
object
|
|
Теги ресурсов
|
type
|
string
|
|
Тип ресурса Azure
|
WebTestGeolocation
Object
Гео физическое расположение для запуска WebTest из. Для запуска теста необходимо указать одно или несколько расположений.
Имя |
Тип |
Описание |
Id
|
string
|
Идентификатор расположения для запуска WebTest.
|
WebTestKind
Перечисление
Тип WebTest, который просматривает этот веб-тест. Выбор — это связь, многоэтапная и стандартная.
Значение |
Описание |
multistep
|
|
ping
|
|
standard
|
|