Web Tests - Create Or Update
Skapar eller uppdaterar en Application Insights-webbtestdefinition.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/webtests/{webTestName}?api-version=2022-06-15URI-parametrar
| Name | I | Obligatorisk | Typ | Description | 
|---|---|---|---|---|
| resource | path | True | stringminLength: 1 maxLength: 90 | Namnet på resursgruppen. Namnet är skiftlägesokänsligt. | 
| subscription | path | True | stringminLength: 1 | ID för målprenumerationen. | 
| web | path | True | string | Namnet på Application Insights WebTest-resursen. | 
| api-version | query | True | stringminLength: 1 | DEN API-version som ska användas för den här åtgärden. | 
Begärandetext
| Name | Obligatorisk | Typ | Description | 
|---|---|---|---|
| location | True | string | Resursplats | 
| properties.Kind | True | Den typ av webbtest det här är, giltiga val är ping, flera steg och standard. | |
| properties.Locations | True | En lista över var du fysiskt kan köra testerna från för att ge global täckning för programmets tillgänglighet. | |
| properties.Name | True | string | Användardefinierat namn om detta WebTest. | 
| properties.SyntheticMonitorId | True | string | Unikt ID för detta WebTest. Detta är vanligtvis samma värde som fältet Namn. | 
| kind | Den typ av WebTest som det här webbtestet tittar på. Alternativen är ping, multisteg och standard. | ||
| properties.Configuration | En XML-konfigurationsspecifikation för ett WebTest. | ||
| properties.Description | string | Användardefinierad beskrivning för detta WebTest. | |
| properties.Enabled | boolean | Övervakas testet aktivt. | |
| properties.Frequency | integer (int32) | Intervall i sekunder mellan testkörningar för detta WebTest. Standardvärdet är 300. | |
| properties.Request | Samlingen med egenskaper för begäranden | ||
| properties.RetryEnabled | boolean | Tillåt återförsök om webtestet misslyckas. | |
| properties.Timeout | integer (int32) | Sekunder tills denna WebTest överskrider tidsgränsen och misslyckas. Standardvärdet är 30. | |
| properties.ValidationRules | Samlingen med egenskaper för verifieringsregeln | ||
| tags | object | Resurstaggar | 
Svar
| Name | Typ | Description | 
|---|---|---|
| 200 OK | Ett Application Insights-webbtest har skapats eller uppdaterats. | 
Säkerhet
azure_auth
Azure Active Directory OAuth2-flöde.
					Typ: 
					oauth2
					Flow: 
					implicit
					Auktoriseringswebbadress: 
					https://login.microsoftonline.com/common/oauth2/authorize
			
Omfattningar
| Name | Description | 
|---|---|
| user_impersonation | personifiera ditt användarkonto | 
Exempel
| web | 
| web | 
| web | 
webTestCreate  
			Exempelbegäran
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"
      }
    ]
  }
}
Exempelsvar
{
  "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   
			Exempelbegäran
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"
      }
    ]
  }
}
Exempelsvar
{
  "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  
			Exempelbegäran
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"
  }
}
Exempelsvar
{
  "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"
  }
}Definitioner
| Name | Description | 
|---|---|
| Configuration | En XML-konfigurationsspecifikation för ett WebTest. | 
| Content | Samlingen med egenskaper för innehållsverifiering | 
| Header | En rubrik som ska läggas till i WebTest. | 
| Request | Samlingen med egenskaper för begäranden | 
| Validation | Samlingen med egenskaper för verifieringsregeln | 
| Web | En Application Insights WebTest-definition. | 
| Web | Geo-fysisk plats för att köra ett WebTest från. Du måste ange en eller flera platser som testet ska köras från. | 
| Web | Den typ av WebTest som det här webbtestet tittar på. Alternativen är ping, multisteg och standard. | 
Configuration
En XML-konfigurationsspecifikation för ett WebTest.
| Name | Typ | Description | 
|---|---|---|
| WebTest | string | XML-specifikationen för ett WebTest som ska köras mot ett program. | 
ContentValidation 
			
			Samlingen med egenskaper för innehållsverifiering
| Name | Typ | Description | 
|---|---|---|
| ContentMatch | string | Innehåll att söka efter i återkomsten av WebTest. Får inte vara null eller tom. | 
| IgnoreCase | boolean | När värdet anges blir ContentMatch-valideringsfallet okänsligt. | 
| PassIfTextFound | boolean | När det är sant godkänns valideringen om det finns en matchning för ContentMatch-strängen. Om det är falskt misslyckas verifieringen om det finns en matchning | 
HeaderField 
			
			En rubrik som ska läggas till i WebTest.
| Name | Typ | Description | 
|---|---|---|
| key | string | Namnet på rubriken. | 
| value | string | Värdet för rubriken. | 
Request
Samlingen med egenskaper för begäranden
| Name | Typ | Description | 
|---|---|---|
| FollowRedirects | boolean | Följ omdirigeringarna för det här webbtestet. | 
| Headers | Lista över rubriker och deras värden som ska läggas till i WebTest-anropet. | |
| HttpVerb | string | Http-verb som ska användas för det här webbtestet. | 
| ParseDependentRequests | boolean | Parsa beroende begäran för denna WebTest. | 
| RequestBody | string | Base64-kodad strängtext som ska skickas med det här webbtestet. | 
| RequestUrl | string | Url-plats som ska testas. | 
ValidationRules 
			
			Samlingen med egenskaper för verifieringsregeln
| Name | Typ | Description | 
|---|---|---|
| ContentValidation | Samlingen med egenskaper för innehållsverifiering | |
| ExpectedHttpStatusCode | integer (int32) | Kontrollera att WebTest returnerar den angivna http-statuskoden. | 
| IgnoreHttpStatusCode | boolean | När inställningen är inställd ignoreras statuskoden i valideringen. | 
| SSLCertRemainingLifetimeCheck | integer (int32) | Ett antal dagar att kontrollera kvarstår innan det befintliga SSL-certifikatet upphör att gälla. Värdet måste vara positivt och SSLCheck måste vara inställt på true. | 
| SSLCheck | boolean | Kontrollerar om SSL-certifikatet fortfarande är giltigt. | 
WebTest 
			
			En Application Insights WebTest-definition.
| Name | Typ | Standardvärde | Description | 
|---|---|---|---|
| id | string | Azure-resurs-ID | |
| kind | ping | Den typ av WebTest som det här webbtestet tittar på. Alternativen är ping, multisteg och standard. | |
| location | string | Resursplats | |
| name | string | Azure-resursnamn | |
| properties.Configuration | En XML-konfigurationsspecifikation för ett WebTest. | ||
| properties.Description | string | Användardefinierad beskrivning för detta WebTest. | |
| properties.Enabled | boolean | Övervakas testet aktivt. | |
| properties.Frequency | integer (int32) | 300 | Intervall i sekunder mellan testkörningar för detta WebTest. Standardvärdet är 300. | 
| properties.Kind | ping | Den typ av webbtest det här är, giltiga val är ping, flera steg och standard. | |
| properties.Locations | En lista över var du fysiskt kan köra testerna från för att ge global täckning för programmets tillgänglighet. | ||
| properties.Name | string | Användardefinierat namn om detta WebTest. | |
| properties.Request | Samlingen med egenskaper för begäranden | ||
| properties.RetryEnabled | boolean | Tillåt återförsök om webtestet misslyckas. | |
| properties.SyntheticMonitorId | string | Unikt ID för detta WebTest. Detta är vanligtvis samma värde som fältet Namn. | |
| properties.Timeout | integer (int32) | 30 | Sekunder tills denna WebTest överskrider tidsgränsen och misslyckas. Standardvärdet är 30. | 
| properties.ValidationRules | Samlingen med egenskaper för verifieringsregeln | ||
| properties.provisioningState | string | Aktuellt tillstånd för den här komponenten, oavsett om den har etablerats i resursgruppen eller inte, definieras den. Användare kan inte ändra det här värdet men kan läsa från det. Värdena inkluderar Succeeded, Deploying, Canceled och Failed. | |
| tags | object | Resurstaggar | |
| type | string | Azure-resurstyp | 
WebTestGeolocation  
			
			Geo-fysisk plats för att köra ett WebTest från. Du måste ange en eller flera platser som testet ska köras från.
| Name | Typ | Description | 
|---|---|---|
| Id | string | Plats-ID för WebTest som ska köras från. | 
WebTestKind  
			
			Den typ av WebTest som det här webbtestet tittar på. Alternativen är ping, multisteg och standard.
| Värde | Description | 
|---|---|
| ping | |
| multistep | |
| standard |