New-AzApplicationInsightsWebTest
Hiermee maakt of werkt u een Application Insights-webtestdefinitie bij.
Syntaxis
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
Hiermee maakt of werkt u een Application Insights-webtestdefinitie bij.
Voorbeelden
Voorbeeld 1: Hiermee wordt een standaardtype van de Application Insights-webtest gemaakt of bijgewerkt
$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
Met deze opdracht maakt of werkt u een standaardtype van de Application Insights-webtest aan.
We voeren verborgen koppeling in de parameter Tag
in om WebTest en Application Insights te koppelen.
Voorbeeld 2: Hiermee maakt of werkt u een standaardtype van de Application Insights-webtest met de status Uitgeschakeld
$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
Met deze opdracht maakt of werkt u een standaardtype van de Application Insights-webtest in uitgeschakelde status bij.
De schakelparameter '-Enabled' moet expliciet worden ingesteld op $false om de test uit te schakelen.
Voorbeeld 3: Hiermee maakt u een standaardtype van de Application Insights-webtest met een aangepaste header
$headerField = New-AzApplicationInsightsWebTestHeaderFieldObject -Name "HeaderName1" -Value "HeaderValue1"
New-AzApplicationInsightsWebTest -ResourceGroupName exampleRG -Name expwshelltestheader2 -Location 'westus2' -Tag @{"hidden-link:<RESOURCE URL>" = "Resource"} -RequestUrl "https://www.bing.com" -RequestHttpVerb "GET" -TestName 'expwshelltestheader2' -RuleExpectedHttpStatusCode 200 -Frequency 300 -Enabled -Timeout 120 -Kind 'standard' -RetryEnabled -GeoLocation $geoLocation -RequestHeader $headerField
Name Location WebTestKind ResourceGroupName Enabled
---- -------- ----------- ----------------- -------
expwshellheader2 westus2 standard exampleRG True
Met deze opdracht maakt u een standaardtype van de Application Insights-webtest met een aangepaste header
Voorbeeld 4: Hiermee maakt of werkt u een ping-type van de Application Insights-webtest
$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
Met deze opdracht wordt een pingtype van de Application Insights-webtest gemaakt of bijgewerkt.
Voorbeeld 5: Hiermee maakt of werkt u een pingtype van de Application Insights-webtest met aangepaste configuratie bij
$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
Met deze opdracht maakt of werkt u een pingtype van de Application Insights-webtest met aangepaste configuratie bij.
Parameters
-Configuration
De XML-specificatie van een WebTest die moet worden uitgevoerd voor een toepassing.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Confirm
U wordt gevraagd om bevestiging voordat u de cmdlet uitvoert.
Type: | SwitchParameter |
Aliassen: | cf |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ContentIgnoreCase
Wanneer deze waarde is ingesteld, is de case voor validatie van ContentMatch niet hoofdlettergevoelig.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ContentMatch
Inhoud die moet worden gezocht in de return van de WebTest. Mag niet null of leeg zijn.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ContentPassIfTextFound
Wanneer waar, wordt de validatie doorgegeven als er een overeenkomst is voor de ContentMatch-tekenreeks. Als dit onwaar is, mislukt de validatie als er een overeenkomst is
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-DefaultProfile
De referenties, accounts, tenants en abonnementen die worden gebruikt voor communicatie met Azure.
Type: | PSObject |
Aliassen: | AzureRMContext, AzureCredential |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Description
Door de gebruiker gedefinieerde beschrijving voor deze WebTest.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Enabled
Wordt de test actief bewaakt.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Frequency
Interval in seconden tussen testuitvoeringen voor deze WebTest. De standaardwaarde is 300.
Type: | Int32 |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-GeoLocation
Een lijst met waar u de tests fysiek kunt uitvoeren om globale dekking te bieden voor toegankelijkheid van uw toepassing. Zie de sectie NOTES voor geolocatie-eigenschappen en maak een hash-tabel om deze samen te stellen.
Type: | IWebTestGeolocation[] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Kind
Dit is het soort webtest, geldige keuzes zijn ping, multistep en standaard.
Type: | WebTestKindEnum |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Location
Resourcelocatie
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Name
De naam van de Application Insights WebTest-resource.
Type: | String |
Aliassen: | WebTestName |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RequestBody
Met Base64 gecodeerde tekenreekstekst die met deze webtest moet worden verzonden.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RequestFollowRedirect
Volg omleidingen voor deze webtest.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RequestHeader
Lijst met headers en de bijbehorende waarden om toe te voegen aan de webtest-aanroep. Zie de sectie NOTES voor REQUESTHEADER-eigenschappen en maak een hash-tabel om deze samen te stellen.
Type: | IHeaderField[] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RequestHttpVerb
Http-werkwoord dat moet worden gebruikt voor deze webtest.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RequestParseDependent
ParseEr afhankelijke aanvraag voor deze WebTest.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RequestUrl
Url-locatie die moet worden getest.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ResourceGroupName
De naam van de resourcegroep. De naam is niet hoofdlettergevoelig.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RetryEnabled
Toestaan voor nieuwe pogingen als deze webtest mislukt.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RuleExpectedHttpStatusCode
Controleer of de WebTest de opgegeven HTTP-statuscode retourneert.
Type: | Int32 |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RuleIgnoreHttpsStatusCode
Wanneer deze is ingesteld, negeert de validatie de statuscode.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RuleSslCertRemainingLifetimeCheck
Een aantal dagen om te controleren blijft bestaan voordat het bestaande SSL-certificaat verloopt. De waarde moet positief zijn en de SSLCheck moet zijn ingesteld op true.
Type: | Int32 |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RuleSslCheck
Controleert of het SSL-certificaat nog steeds geldig is.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-SubscriptionId
De id van het doelabonnement.
Type: | String |
Position: | Named |
Default value: | (Get-AzContext).Subscription.Id |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Tag
Resourcetags
Type: | Hashtable |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-TestName
Door de gebruiker gedefinieerde naam als deze WebTest.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Timeout
Seconden totdat deze WebTest een time-out krijgt en mislukt. De standaardwaarde is 30.
Type: | Int32 |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-WhatIf
Toont wat er zou gebeuren als de cmdlet wordt uitgevoerd. De cmdlet wordt niet uitgevoerd.
Type: | SwitchParameter |
Aliassen: | wi |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
Uitvoerwaarden
Azure PowerShell