Aracılığıyla paylaş


Web Tests - Create Or Update

Application Insights web testi tanımını oluşturur veya güncelleştirir.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}?api-version=2022-06-15

URI Parametreleri

Name İçinde Gerekli Tür Description
resourceGroupName
path True

string

Kaynak grubunun adı. Ad büyük/küçük harfe duyarlı değildir.

subscriptionId
path True

string

Hedef aboneliğin kimliği.

webTestName
path True

string

Application Insights WebTest kaynağının adı.

api-version
query True

string

Bu işlem için kullanılacak API sürümü.

İstek Gövdesi

Name Gerekli Tür Description
location True

string

Kaynak konumu

properties.Kind True

WebTestKind

Bu web testinin türü, geçerli seçenekler ping, çok adımlı ve standarttır.

properties.Locations True

WebTestGeolocation[]

Uygulamanızın erişilebilirliği için genel kapsam sağlamak üzere testleri fiziksel olarak çalıştırabileceğiniz yerin listesi.

properties.Name True

string

Bu WebTest ise kullanıcı tanımlı ad.

properties.SyntheticMonitorId True

string

Bu WebTest'in benzersiz kimliği. Bu genellikle Ad alanıyla aynı değerdir.

kind

WebTestKind

Bu web testinin izlediği WebTest türü. Seçenekler ping, çok adımlı ve standarttır.

properties.Configuration

Configuration

WebTest için XML yapılandırma belirtimi.

properties.Description

string

Bu WebTest için kullanıcı tanımlı açıklama.

properties.Enabled

boolean

Test etkin bir şekilde izleniyor mu?

properties.Frequency

integer

Bu WebTest için test çalıştırmaları arasındaki saniye cinsinden aralık. Varsayılan değer 300'dür.

properties.Request

Request

İstek özellikleri koleksiyonu

properties.RetryEnabled

boolean

Bu WebTest başarısız olursa yeniden denemelere izin ver.

properties.Timeout

integer

Bu WebTest zaman aşımına uğrar ve başarısız olur. Varsayılan değer 30’dur.

properties.ValidationRules

ValidationRules

Geçerlilik kuralı özellikleri koleksiyonu

tags

object

Kaynak etiketleri

Yanıtlar

Name Tür Description
200 OK

WebTest

Application Insights web testi başarıyla oluşturuldu veya güncelleştirildi.

Güvenlik

azure_auth

Azure Active Directory OAuth2 Flow.

Tür: oauth2
Akış: implicit
Yetkilendirme URL’si: https://login.microsoftonline.com/common/oauth2/authorize

Kapsamlar

Name Description
user_impersonation kullanıcı hesabınızın kimliğine bürünme

Örnekler

webTestCreate
webTestCreateStandard
webTestUpdate

webTestCreate

Örnek isteği

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"
      }
    ]
  }
}

Örnek yanıt

{
  "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

Örnek isteği

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"
      }
    ]
  }
}

Örnek yanıt

{
  "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

Örnek isteği

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"
  }
}

Örnek yanıt

{
  "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"
  }
}

Tanımlar

Name Description
Configuration

WebTest için XML yapılandırma belirtimi.

ContentValidation

İçerik doğrulama özelliklerinin koleksiyonu

HeaderField

WebTest'e eklenecek üst bilgi.

Request

İstek özellikleri koleksiyonu

ValidationRules

Geçerlilik kuralı özellikleri koleksiyonu

WebTest

Application Insights WebTest tanımı.

WebTestGeolocation

WebTest'in çalıştırılacak coğrafi fiziksel konum. Testin çalıştırılabilmesi için bir veya daha fazla konum belirtmeniz gerekir.

WebTestKind

Bu web testinin izlediği WebTest türü. Seçenekler ping, çok adımlı ve standarttır.

Configuration

WebTest için XML yapılandırma belirtimi.

Name Tür Description
WebTest

string

WebTest'in bir uygulamaya karşı çalıştırılacak XML belirtimi.

ContentValidation

İçerik doğrulama özelliklerinin koleksiyonu

Name Tür Description
ContentMatch

string

WebTest'in iadesinde aranacak içerik. Null veya boş olmamalıdır.

IgnoreCase

boolean

Bu değer ayarlandığında ContentMatch doğrulama olayına duyarsız hale gelir.

PassIfTextFound

boolean

Doğru olduğunda, ContentMatch dizesi için bir eşleşme varsa doğrulama başarılı olur. False ise, eşleşme varsa doğrulama başarısız olur

HeaderField

WebTest'e eklenecek üst bilgi.

Name Tür Description
key

string

Üst bilginin adı.

value

string

Üst bilginin değeri.

Request

İstek özellikleri koleksiyonu

Name Tür Description
FollowRedirects

boolean

Bu web testi için yeniden yönlendirmeleri izleyin.

Headers

HeaderField[]

WebTest çağrısına eklenecek üst bilgilerin ve değerlerinin listesi.

HttpVerb

string

Bu web testi için kullanılacak Http fiili.

ParseDependentRequests

boolean

Bu WebTest için Bağımlı isteği ayrıştır.

RequestBody

string

Bu web testiyle gönderilecek Base64 kodlanmış dize gövdesi.

RequestUrl

string

Test için URL konumu.

ValidationRules

Geçerlilik kuralı özellikleri koleksiyonu

Name Tür Description
ContentValidation

ContentValidation

İçerik doğrulama özelliklerinin koleksiyonu

ExpectedHttpStatusCode

integer

WebTest'in sağlanan http durum kodunu döndürdüğünü doğrulayın.

IgnoreHttpStatusCode

boolean

Ayarlandığında doğrulama durum kodunu yoksayar.

SSLCertRemainingLifetimeCheck

integer

Mevcut SSL sertifikasının süresi dolmadan önce denetlenecek birkaç gün kalır. Değer pozitif olmalı ve SSLCheck değeri true olarak ayarlanmalıdır.

SSLCheck

boolean

SSL sertifikasının hala geçerli olup olmadığını denetler.

WebTest

Application Insights WebTest tanımı.

Name Tür Default value Description
id

string

Azure kaynak kimliği

kind

WebTestKind

ping

Bu web testinin izlediği WebTest türü. Seçenekler ping, çok adımlı ve standarttır.

location

string

Kaynak konumu

name

string

Azure kaynak adı

properties.Configuration

Configuration

WebTest için XML yapılandırma belirtimi.

properties.Description

string

Bu WebTest için kullanıcı tanımlı açıklama.

properties.Enabled

boolean

Test etkin bir şekilde izleniyor mu?

properties.Frequency

integer

300

Bu WebTest için test çalıştırmaları arasındaki saniye cinsinden aralık. Varsayılan değer 300'dür.

properties.Kind

WebTestKind

ping

Bu web testinin türü, geçerli seçenekler ping, çok adımlı ve standarttır.

properties.Locations

WebTestGeolocation[]

Uygulamanızın erişilebilirliği için genel kapsam sağlamak üzere testleri fiziksel olarak çalıştırabileceğiniz yerin listesi.

properties.Name

string

Bu WebTest ise kullanıcı tanımlı ad.

properties.Request

Request

İstek özellikleri koleksiyonu

properties.RetryEnabled

boolean

Bu WebTest başarısız olursa yeniden denemelere izin ver.

properties.SyntheticMonitorId

string

Bu WebTest'in benzersiz kimliği. Bu genellikle Ad alanıyla aynı değerdir.

properties.Timeout

integer

30

Bu WebTest zaman aşımına uğrar ve başarısız olur. Varsayılan değer 30’dur.

properties.ValidationRules

ValidationRules

Geçerlilik kuralı özellikleri koleksiyonu

properties.provisioningState

string

Bu bileşenin geçerli durumu; tanımlandığı kaynak grubu içinde sağlanıp sağlanmadığı. Kullanıcılar bu değeri değiştiremez ancak bu değerden okuyabilir. Değerler Başarılı, Dağıtıldı, İptal Edildi ve Başarısız değerlerini içerir.

tags

object

Kaynak etiketleri

type

string

Azure kaynak türü

WebTestGeolocation

WebTest'in çalıştırılacak coğrafi fiziksel konum. Testin çalıştırılabilmesi için bir veya daha fazla konum belirtmeniz gerekir.

Name Tür Description
Id

string

WebTest'in çalıştırılacak konum kimliği.

WebTestKind

Bu web testinin izlediği WebTest türü. Seçenekler ping, çok adımlı ve standarttır.

Name Tür Description
multistep

string

ping

string

standard

string