Aracılığıyla paylaş


New-AzApplicationInsightsWebTest

Web testi tanımı Analizler uygulama oluşturur veya güncelleştirir.

Syntax

New-AzApplicationInsightsWebTest
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -Location <String>
   [-ContentIgnoreCase]
   [-ContentMatch <String>]
   [-ContentPassIfTextFound]
   [-Description <String>]
   [-Enabled]
   [-Frequency <Int32>]
   [-GeoLocation <IWebTestGeolocation[]>]
   [-Kind <WebTestKindEnum>]
   [-RequestBody <String>]
   [-RequestFollowRedirect]
   [-RequestHeader <IHeaderField[]>]
   [-RequestHttpVerb <String>]
   [-RequestParseDependent]
   [-RequestUrl <String>]
   [-RetryEnabled]
   [-RuleExpectedHttpStatusCode <Int32>]
   [-RuleIgnoreHttpsStatusCode]
   [-RuleSslCertRemainingLifetimeCheck <Int32>]
   [-RuleSslCheck]
   [-Tag <Hashtable>]
   [-TestName <String>]
   [-Timeout <Int32>]
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzApplicationInsightsWebTest
   -Name <String>
   -ResourceGroupName <String>
   [-SubscriptionId <String>]
   -Location <String>
   [-ContentMatch <String>]
   [-Description <String>]
   [-Enabled]
   [-Frequency <Int32>]
   [-GeoLocation <IWebTestGeolocation[]>]
   [-Kind <WebTestKindEnum>]
   [-RequestParseDependent]
   [-RequestUrl <String>]
   [-RetryEnabled]
   [-RuleExpectedHttpStatusCode <Int32>]
   [-Tag <Hashtable>]
   [-TestName <String>]
   [-Timeout <Int32>]
   [-Configuration <String>]
   [-DefaultProfile <PSObject>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Web testi tanımı Analizler uygulama oluşturur veya güncelleştirir.

Örnekler

Örnek 1: Standart türde bir Uygulama Analizler web testi oluşturur veya güncelleştirir

$geoLocation = @()
$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr"
$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr"
New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' `
-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} `
-RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' `
-RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation

Name            Location WebTestKind ResourceGroupName  Enabled
----            -------- ----------- -----------------  -------
standard-pwsh01 westus2  standard    azpwsh-rg-test     True

Bu komut, standart türde bir Application Analizler web testi oluşturur veya güncelleştirir.

WebTest ve Uygulama Analizler ilişkilendirmek için parametresine hidden-link Tag gireriz.

Örnek 2: Uygulama Analizler web testinin standart bir türünü devre dışı durumda oluşturur veya güncelleştirir

$geoLocation = @()
$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr"
$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr"
New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name standard-pwsh01 -Location 'westus2' `
-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} `
-RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'standard-pwsh01' `
-RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled:$false -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation

Name            Location WebTestKind ResourceGroupName  Enabled
----            -------- ----------- -----------------  -------
standard-pwsh01 westus2  standard    azpwsh-rg-test     False

Bu komut, application Analizler web testinin standart bir türünü devre dışı durumda oluşturur veya güncelleştirir.

"-Enabled" anahtar parametresi, testi devre dışı bırakmak için açıkça $false olarak ayarlanmalıdır.

Örnek 3: Uygulama Analizler web testinin ping türünü oluşturur veya güncelleştirir

$geoLocation = @()
$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr"
$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr"
New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' `
-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} `
-GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 `
-Kind 'ping' -RequestUrl 'https://cn.bing.com' -RequestParseDependent -RuleExpectedHttpStatusCode 200 `
-ContentMatch "status"

Name               Location WebTestKind ResourceGroupName   Enabled
----               -------- ----------- -----------------   -------
pingwebtest-pwsh01 westus2  ping        azpwsh-rg-test      True

Bu komut, Application Analizler web testinin ping türünü oluşturur veya güncelleştirir.

Örnek 4: Özel yapılandırmayla Uygulama Analizler web testinin ping türünü oluşturur veya güncelleştirir

$geoLocation = @()
$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "emea-nl-ams-azr"
$geoLocation += New-AzApplicationInsightsWebTestGeolocationObject -Location "us-ca-sjc-azr"
New-AzApplicationInsightsWebTest -ResourceGroupName azpwsh-rg-test -Name 'pingwebtest-pwsh01' -TestName 'pingwentest-pwsh01testname' -Location 'westus2' `
-Tag @{"hidden-link:/subscriptions/xxxxxxxxxx-xxxx-xxxxx-xxxxxxxxxxxx/resourceGroups/azpwsh-rg-test/providers/microsoft.insights/components/appinsights-portal01" = "Resource"} `
-GeoLocation $geoLocation -RetryEnabled -Enabled -Frequency 300 -Timeout 90 `
-Kind 'ping' `
-Configuration "<WebTest  Name=`"basic-portal03`"  Id=`"9407db10-5d84-487f-98a3-a1ee67bb98f0`"  Enabled=`"True`"  CssProjectStructure=`"`"  CssIteration=`"`"  Timeout=`"90`"  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=`"a2025e53-0702-d03e-f311-5774ec16893d`"  Version=`"1.1`"  Url=`"https://www.bing.com`"  ThinkTime=`"0`"  Timeout=`"90`"  ParseDependentRequests=`"True`"  FollowRedirects=`"True`"  RecordResult=`"True`"  Cache=`"False`"  ResponseTimeGoal=`"0`"  Encoding=`"utf-8`"  ExpectedHttpStatusCode=`"200`"  ExpectedResponseUrl=`"`"  ReportingName=`"`"  IgnoreHttpStatusCode=`"False`" />
    </Items>
    <ValidationRules>
        <ValidationRule  Classname=`"Microsoft.VisualStudio.TestTools.WebTesting.Rules.ValidationRuleFindText, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a`"  DisplayName=`"Find Text`"  Description=`"Verifies the existence of the specified text in the response.`"  Level=`"High`"  ExectuionOrder=`"BeforeDependents`">
            <RuleParameters>
            <RuleParameter Name=`"FindText`" Value=`"test content match`" />
            <RuleParameter Name=`"IgnoreCase`" Value=`"False`" />
            <RuleParameter Name=`"UseRegularExpression`" Value=`"False`" />
            <RuleParameter Name=`"PassIfTextFound`" Value=`"True`" />
            </RuleParameters>
        </ValidationRule>
    </ValidationRules>
</WebTest>"

Name               Location WebTestKind ResourceGroupName   Enabled
----               -------- ----------- -----------------   -------
pingwebtest-pwsh01 westus2  ping        azpwsh-rg-test      True

Bu komut, özel yapılandırmayla Uygulama Analizler web testinin ping türünü oluşturur veya güncelleştirir.

Parametreler

-Configuration

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

Tür:String
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Cmdlet'i çalıştırmadan önce sizden onay ister.

Tür:SwitchParameter
Aliases:cf
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-ContentIgnoreCase

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

Tür:SwitchParameter
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-ContentMatch

WebTest'in dönüşünde aranacak içerik. Null veya boş olmamalıdır.

Tür:String
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-ContentPassIfTextFound

True 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

Tür:SwitchParameter
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

Azure ile iletişim için kullanılan kimlik bilgileri, hesap, kiracı ve abonelik.

Tür:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-Description

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

Tür:String
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-Enabled

Test etkin olarak izleniyor mu?

Tür:SwitchParameter
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-Frequency

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

Tür:Int32
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-GeoLocation

Uygulamanızın erişilebilirliği için genel kapsam sağlamak üzere testleri fiziksel olarak çalıştırabileceğiniz yerlerin listesi. Oluşturmak için GEOLOCATION özellikleri için NOTES bölümüne bakın ve karma tablo oluşturun.

Tür:IWebTestGeolocation[]
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-Kind

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

Tür:WebTestKindEnum
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

Kaynak konumu

Tür:String
Position:Named
varsayılan değer:None
Gerekli:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

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

Tür:String
Aliases:WebTestName
Position:Named
varsayılan değer:None
Gerekli:True
Accept pipeline input:False
Accept wildcard characters:False

-RequestBody

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

Tür:String
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-RequestFollowRedirect

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

Tür:SwitchParameter
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-RequestHeader

WebTest çağrısına eklenecek üst bilgilerin ve değerlerinin listesi. Oluşturmak için REQUESTHEADER özellikleri için NOTES bölümüne bakın ve bir karma tablo oluşturun.

Tür:IHeaderField[]
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-RequestHttpVerb

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

Tür:String
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-RequestParseDependent

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

Tür:SwitchParameter
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-RequestUrl

Test için URL konumu.

Tür:String
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Kaynak grubunun adı. Ad büyük/küçük harfe duyarsız.

Tür:String
Position:Named
varsayılan değer:None
Gerekli:True
Accept pipeline input:False
Accept wildcard characters:False

-RetryEnabled

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

Tür:SwitchParameter
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-RuleExpectedHttpStatusCode

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

Tür:Int32
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-RuleIgnoreHttpsStatusCode

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

Tür:SwitchParameter
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-RuleSslCertRemainingLifetimeCheck

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.

Tür:Int32
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-RuleSslCheck

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

Tür:SwitchParameter
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-SubscriptionId

Hedef aboneliğin kimliği.

Tür:String
Position:Named
varsayılan değer:(Get-AzContext).Subscription.Id
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-Tag

Kaynak etiketleri

Tür:Hashtable
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-TestName

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

Tür:String
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-Timeout

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

Tür:Int32
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Cmdlet çalıştırılıyorsa ne olacağını gösterir. Cmdlet çalıştırılmaz.

Tür:SwitchParameter
Aliases:wi
Position:Named
varsayılan değer:None
Gerekli:False
Accept pipeline input:False
Accept wildcard characters:False

Çıkışlar

IWebTest