New-AzApplicationInsightsWebTest
Crea o aggiorna una definizione di test Web di Application Insights.
Sintassi
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>]
Descrizione
Crea o aggiorna una definizione di test Web di Application Insights.
Esempio
Esempio 1: crea o aggiorna un tipo standard di test Web di Application Insights
$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
Questo comando crea o aggiorna un tipo standard di test Web di Application Insights.
Immettere hidden-link nel parametro Tag
per associare WebTest e Application Insights.
Esempio 2: Crea o aggiorna un tipo standard di test Web di Application Insights in stato disabilitato
$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
Questo comando crea o aggiorna un tipo standard di test Web di Application Insights in stato disabilitato.
Il parametro switch "-Enabled" deve essere impostato in modo esplicito su $false per disabilitare il test.
Esempio 3: Crea un tipo standard di test Web di Application Insights con un'intestazione personalizzata
$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
Questo comando crea un tipo standard di test Web di Application Insights con un'intestazione personalizzata
Esempio 4: Crea o aggiorna un tipo di ping del test Web di Application Insights
$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
Questo comando crea o aggiorna un tipo di ping del test Web di Application Insights.
Esempio 5: Crea o aggiorna un tipo di ping del test Web di Application Insights con configurazione personalizzata
$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
Questo comando crea o aggiorna un tipo di ping del test Web di Application Insights con configurazione personalizzata.
Parametri
-Configuration
Specifica XML di un webTest da eseguire su un'applicazione.
Tipo: | String |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-Confirm
Richiede conferma prima di eseguire il cmdlet.
Tipo: | SwitchParameter |
Alias: | cf |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-ContentIgnoreCase
Se impostato, questo valore rende senza distinzione tra maiuscole e minuscole di convalida ContentMatch.
Tipo: | SwitchParameter |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-ContentMatch
Contenuto da cercare nella restituzione di WebTest. Non deve essere null o vuoto.
Tipo: | String |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-ContentPassIfTextFound
Se true, la convalida passerà se esiste una corrispondenza per la stringa ContentMatch. Se false, la convalida avrà esito negativo se è presente una corrispondenza
Tipo: | SwitchParameter |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-DefaultProfile
Credenziali, account, tenant e sottoscrizione usati per la comunicazione con Azure.
Tipo: | PSObject |
Alias: | AzureRMContext, AzureCredential |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-Description
Descrizione definita dall'utente per questo test Web.
Tipo: | String |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-Enabled
Il test viene monitorato attivamente.
Tipo: | SwitchParameter |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-Frequency
Intervallo in secondi tra le esecuzioni dei test per questo test Web. Il valore predefinito è 300.
Tipo: | Int32 |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-GeoLocation
Elenco di dove eseguire fisicamente i test da per fornire una copertura globale per l'accessibilità dell'applicazione. Per costruire, vedere la sezione NOTES per le proprietà GEOLOCATION e creare una tabella hash.
Tipo: | IWebTestGeolocation[] |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-Kind
Il tipo di test Web è, le scelte valide sono ping, multistep e standard.
Tipo: | WebTestKindEnum |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-Location
Percorso risorsa
Tipo: | String |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | True |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-Name
Nome della risorsa WebTest di Application Insights.
Tipo: | String |
Alias: | WebTestName |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | True |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RequestBody
Corpo della stringa con codifica Base64 da inviare con questo test Web.
Tipo: | String |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RequestFollowRedirect
Seguire i reindirizzamenti per questo test Web.
Tipo: | SwitchParameter |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RequestHeader
Elenco di intestazioni e relativi valori da aggiungere alla chiamata WebTest. Per costruire, vedere la sezione NOTES per le proprietà REQUESTHEADER e creare una tabella hash.
Tipo: | IHeaderField[] |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RequestHttpVerb
Verbo HTTP da usare per questo test Web.
Tipo: | String |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RequestParseDependent
Analizzare la richiesta dipendente per questo test Web.
Tipo: | SwitchParameter |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RequestUrl
Percorso URL da testare.
Tipo: | String |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-ResourceGroupName
Nome del gruppo di risorse. Il nome non fa distinzione tra maiuscole e minuscole.
Tipo: | String |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | True |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RetryEnabled
Consentire la ripetizione dei tentativi in caso di esito negativo del test Web.
Tipo: | SwitchParameter |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RuleExpectedHttpStatusCode
Verificare che WebTest restituisca il codice di stato http fornito.
Tipo: | Int32 |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RuleIgnoreHttpsStatusCode
Se impostata, la convalida ignorerà il codice di stato.
Tipo: | SwitchParameter |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RuleSslCertRemainingLifetimeCheck
Un numero di giorni per il controllo rimane ancora prima della scadenza del certificato SSL esistente. Il valore deve essere positivo e SSLCheck deve essere impostato su true.
Tipo: | Int32 |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-RuleSslCheck
Verifica se il certificato SSL è ancora valido.
Tipo: | SwitchParameter |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-SubscriptionId
ID della sottoscrizione di destinazione.
Tipo: | String |
Posizione: | Named |
Valore predefinito: | (Get-AzContext).Subscription.Id |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-Tag
Tag delle risorse
Tipo: | Hashtable |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-TestName
Nome definito dall'utente se il test Web.
Tipo: | String |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-Timeout
Secondi fino a quando il test Web non verrà timeout e avrà esito negativo. Il valore predefinito è 30.
Tipo: | Int32 |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |
-WhatIf
Mostra gli effetti dell'esecuzione del cmdlet. Il cmdlet non viene eseguito.
Tipo: | SwitchParameter |
Alias: | wi |
Posizione: | Named |
Valore predefinito: | None |
Necessario: | False |
Accettare l'input della pipeline: | False |
Accettare caratteri jolly: | False |