Microsoft.Insights webtests
Bicep 資源定義
Webtests 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
若要建立 Microsoft.Insights/webtests 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.Insights/webtests@2022-06-15' = {
kind: 'string'
location: 'string'
name: 'string'
properties: {
Configuration: {
WebTest: 'string'
}
Description: 'string'
Enabled: bool
Frequency: int
Kind: 'string'
Locations: [
{
Id: 'string'
}
]
Name: 'string'
Request: {
FollowRedirects: bool
Headers: [
{
key: 'string'
value: 'string'
}
]
HttpVerb: 'string'
ParseDependentRequests: bool
RequestBody: 'string'
RequestUrl: 'string'
}
RetryEnabled: bool
SyntheticMonitorId: 'string'
Timeout: int
ValidationRules: {
ContentValidation: {
ContentMatch: 'string'
IgnoreCase: bool
PassIfTextFound: bool
}
ExpectedHttpStatusCode: int
IgnoreHttpStatusCode: bool
SSLCertRemainingLifetimeCheck: int
SSLCheck: bool
}
}
tags: {
{customized property}: 'string'
}
}
屬性值
名字 |
描述 |
價值 |
鑰匙 |
標頭的名稱。 |
字串 |
價值 |
標頭的值。 |
字串 |
Microsoft.Insights/webtests
名字 |
描述 |
價值 |
類 |
此 Web 測試所監看的 WebTest 種類。 選項為 ping、multistep 和 standard。 |
'multistep' 'ping' 'standard' |
位置 |
資源位置 |
字串 (必要) |
名字 |
資源名稱 |
字串 (必要) |
性能 |
描述 Azure 資源的 Web 測試的元數據。 |
WebTestProperties |
標籤 |
資源標籤 |
標記名稱和值的字典。 請參閱範本中的 標籤 |
WebTestGeolocation
名字 |
描述 |
價值 |
標識碼 |
要從中執行之 WebTest 的位置標識碼。 |
字串 |
WebTestProperties
名字 |
描述 |
價值 |
配置 |
WebTest 的 XML 組態規格。 |
WebTestPropertiesConfiguration |
描述 |
此 WebTest 的使用者定義描述。 |
字串 |
啟用 |
是否正在主動監視測試。 |
bool |
頻率 |
此 WebTest 的測試回合之間以秒為單位的間隔。 預設值為 300。 |
int |
類 |
這是 Web 測試的類型,有效的選擇是 ping、multistep 和 standard。 |
'multistep' 'ping' 'standard' (必要) |
地點 |
實際執行測試的來源清單,以提供應用程式輔助功能的全域涵蓋範圍。 |
WebTestGeolocation[] (必要) |
名字 |
如果這個 WebTest,則為使用者定義的名稱。 |
字串 (必要) |
請求 |
要求屬性的集合 |
WebTestPropertiesRequest |
RetryEnabled |
如果此 WebTest 失敗,請允許重試。 |
bool |
SyntheticMonitorId |
此 WebTest 的唯一標識碼。 這通常與 [名稱] 欄位的值相同。 |
字串 (必要) |
超時 |
此 WebTest 逾時並失敗的秒數。 預設值為 30。 |
int |
ValidationRules |
驗證規則屬性的集合 |
WebTestPropertiesValidationRules |
WebTestPropertiesConfiguration
名字 |
描述 |
價值 |
WebTest |
要針對應用程式執行的 WebTest XML 規格。 |
字串 |
WebTestPropertiesRequest
名字 |
描述 |
價值 |
FollowRedirects |
請遵循此 Web 測試的重新導向。 |
bool |
頭 |
要新增至 WebTest 呼叫的標頭及其值清單。 |
HeaderField[] |
HttpVerb |
要用於此 Web 測試的 Http 動詞。 |
字串 |
ParseDependentRequests |
剖析此 WebTest 的相依要求。 |
bool |
RequestBody |
使用此 Web 測試傳送的 Base64 編碼字串主體。 |
字串 |
RequestUrl |
要測試的URL位置。 |
字串 |
WebTestPropertiesValidationRules
名字 |
描述 |
價值 |
ContentValidation |
內容驗證屬性的集合 |
WebTestPropertiesValidationRulesContentValidation |
ExpectedHttpStatusCode |
驗證 WebTest 是否傳回提供的 HTTP 狀態代碼。 |
int |
IgnoreHttpStatusCode |
設定時,驗證會忽略狀態代碼。 |
bool |
SSLCertRemainingLifetimeCheck |
在現有 SSL 憑證到期之前,仍要檢查的天數。 值必須是正數,且 SSLCheck 必須設定為 true。 |
int |
SSLCheck |
檢查 SSL 憑證是否仍然有效。 |
bool |
WebTestPropertiesValidationRulesContentValidation
名字 |
描述 |
價值 |
ContentMatch |
在 WebTest 傳回中要尋找的內容。 不得為 Null 或空白。 |
字串 |
IgnoreCase |
設定時,此值會使 ContentMatch 驗證案例不區分。 |
bool |
PassIfTextFound |
若為 true,如果 ContentMatch 字串相符,驗證將會通過。 如果為 false,如果相符項目,驗證將會失敗 |
bool |
使用範例
Azure 已驗證的模組
下列 Azure 驗證模組 可用來部署此資源類型。
ARM 樣本資源定義
Webtests 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
若要建立 Microsoft.Insights/webtests 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.Insights/webtests",
"apiVersion": "2022-06-15",
"name": "string",
"kind": "string",
"location": "string",
"properties": {
"Configuration": {
"WebTest": "string"
},
"Description": "string",
"Enabled": "bool",
"Frequency": "int",
"Kind": "string",
"Locations": [
{
"Id": "string"
}
],
"Name": "string",
"Request": {
"FollowRedirects": "bool",
"Headers": [
{
"key": "string",
"value": "string"
}
],
"HttpVerb": "string",
"ParseDependentRequests": "bool",
"RequestBody": "string",
"RequestUrl": "string"
},
"RetryEnabled": "bool",
"SyntheticMonitorId": "string",
"Timeout": "int",
"ValidationRules": {
"ContentValidation": {
"ContentMatch": "string",
"IgnoreCase": "bool",
"PassIfTextFound": "bool"
},
"ExpectedHttpStatusCode": "int",
"IgnoreHttpStatusCode": "bool",
"SSLCertRemainingLifetimeCheck": "int",
"SSLCheck": "bool"
}
},
"tags": {
"{customized property}": "string"
}
}
屬性值
名字 |
描述 |
價值 |
鑰匙 |
標頭的名稱。 |
字串 |
價值 |
標頭的值。 |
字串 |
Microsoft.Insights/webtests
名字 |
描述 |
價值 |
apiVersion |
API 版本 |
'2022-06-15' |
類 |
此 Web 測試所監看的 WebTest 種類。 選項為 ping、multistep 和 standard。 |
'multistep' 'ping' 'standard' |
位置 |
資源位置 |
字串 (必要) |
名字 |
資源名稱 |
字串 (必要) |
性能 |
描述 Azure 資源的 Web 測試的元數據。 |
WebTestProperties |
標籤 |
資源標籤 |
標記名稱和值的字典。 請參閱範本中的 標籤 |
類型 |
資源類型 |
'Microsoft.Insights/webtests' |
WebTestGeolocation
名字 |
描述 |
價值 |
標識碼 |
要從中執行之 WebTest 的位置標識碼。 |
字串 |
WebTestProperties
名字 |
描述 |
價值 |
配置 |
WebTest 的 XML 組態規格。 |
WebTestPropertiesConfiguration |
描述 |
此 WebTest 的使用者定義描述。 |
字串 |
啟用 |
是否正在主動監視測試。 |
bool |
頻率 |
此 WebTest 的測試回合之間以秒為單位的間隔。 預設值為 300。 |
int |
類 |
這是 Web 測試的類型,有效的選擇是 ping、multistep 和 standard。 |
'multistep' 'ping' 'standard' (必要) |
地點 |
實際執行測試的來源清單,以提供應用程式輔助功能的全域涵蓋範圍。 |
WebTestGeolocation[] (必要) |
名字 |
如果這個 WebTest,則為使用者定義的名稱。 |
字串 (必要) |
請求 |
要求屬性的集合 |
WebTestPropertiesRequest |
RetryEnabled |
如果此 WebTest 失敗,請允許重試。 |
bool |
SyntheticMonitorId |
此 WebTest 的唯一標識碼。 這通常與 [名稱] 欄位的值相同。 |
字串 (必要) |
超時 |
此 WebTest 逾時並失敗的秒數。 預設值為 30。 |
int |
ValidationRules |
驗證規則屬性的集合 |
WebTestPropertiesValidationRules |
WebTestPropertiesConfiguration
名字 |
描述 |
價值 |
WebTest |
要針對應用程式執行的 WebTest XML 規格。 |
字串 |
WebTestPropertiesRequest
名字 |
描述 |
價值 |
FollowRedirects |
請遵循此 Web 測試的重新導向。 |
bool |
頭 |
要新增至 WebTest 呼叫的標頭及其值清單。 |
HeaderField[] |
HttpVerb |
要用於此 Web 測試的 Http 動詞。 |
字串 |
ParseDependentRequests |
剖析此 WebTest 的相依要求。 |
bool |
RequestBody |
使用此 Web 測試傳送的 Base64 編碼字串主體。 |
字串 |
RequestUrl |
要測試的URL位置。 |
字串 |
WebTestPropertiesValidationRules
名字 |
描述 |
價值 |
ContentValidation |
內容驗證屬性的集合 |
WebTestPropertiesValidationRulesContentValidation |
ExpectedHttpStatusCode |
驗證 WebTest 是否傳回提供的 HTTP 狀態代碼。 |
int |
IgnoreHttpStatusCode |
設定時,驗證會忽略狀態代碼。 |
bool |
SSLCertRemainingLifetimeCheck |
在現有 SSL 憑證到期之前,仍要檢查的天數。 值必須是正數,且 SSLCheck 必須設定為 true。 |
int |
SSLCheck |
檢查 SSL 憑證是否仍然有效。 |
bool |
WebTestPropertiesValidationRulesContentValidation
名字 |
描述 |
價值 |
ContentMatch |
在 WebTest 傳回中要尋找的內容。 不得為 Null 或空白。 |
字串 |
IgnoreCase |
設定時,此值會使 ContentMatch 驗證案例不區分。 |
bool |
PassIfTextFound |
若為 true,如果 ContentMatch 字串相符,驗證將會通過。 如果為 false,如果相符項目,驗證將會失敗 |
bool |
使用範例
Azure 快速入門範本
下列 Azure 快速入門範本 部署此資源類型。
範本 |
描述 |
動態 Web 測試建立
|
建立任意數目的 App Insights Web (ping) 測試。 |
可用性測試 計量警示規則
|
此範本會建立 Application Insights 可用性測試,以及監視它的計量警示規則。 |
Webtests 資源類型可以使用目標作業來部署:
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
若要建立 Microsoft.Insights/webtests 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Insights/webtests@2022-06-15"
name = "string"
kind = "string"
location = "string"
tags = {
{customized property} = "string"
}
body = jsonencode({
properties = {
Configuration = {
WebTest = "string"
}
Description = "string"
Enabled = bool
Frequency = int
Kind = "string"
Locations = [
{
Id = "string"
}
]
Name = "string"
Request = {
FollowRedirects = bool
Headers = [
{
key = "string"
value = "string"
}
]
HttpVerb = "string"
ParseDependentRequests = bool
RequestBody = "string"
RequestUrl = "string"
}
RetryEnabled = bool
SyntheticMonitorId = "string"
Timeout = int
ValidationRules = {
ContentValidation = {
ContentMatch = "string"
IgnoreCase = bool
PassIfTextFound = bool
}
ExpectedHttpStatusCode = int
IgnoreHttpStatusCode = bool
SSLCertRemainingLifetimeCheck = int
SSLCheck = bool
}
}
})
}
屬性值
名字 |
描述 |
價值 |
鑰匙 |
標頭的名稱。 |
字串 |
價值 |
標頭的值。 |
字串 |
Microsoft.Insights/webtests
名字 |
描述 |
價值 |
類 |
此 Web 測試所監看的 WebTest 種類。 選項為 ping、multistep 和 standard。 |
'multistep' 'ping' 'standard' |
位置 |
資源位置 |
字串 (必要) |
名字 |
資源名稱 |
字串 (必要) |
性能 |
描述 Azure 資源的 Web 測試的元數據。 |
WebTestProperties |
標籤 |
資源標籤 |
標記名稱和值的字典。 |
類型 |
資源類型 |
“Microsoft.Insights/webtests@2022-06-15” |
WebTestGeolocation
名字 |
描述 |
價值 |
標識碼 |
要從中執行之 WebTest 的位置標識碼。 |
字串 |
WebTestProperties
名字 |
描述 |
價值 |
配置 |
WebTest 的 XML 組態規格。 |
WebTestPropertiesConfiguration |
描述 |
此 WebTest 的使用者定義描述。 |
字串 |
啟用 |
是否正在主動監視測試。 |
bool |
頻率 |
此 WebTest 的測試回合之間以秒為單位的間隔。 預設值為 300。 |
int |
類 |
這是 Web 測試的類型,有效的選擇是 ping、multistep 和 standard。 |
'multistep' 'ping' 'standard' (必要) |
地點 |
實際執行測試的來源清單,以提供應用程式輔助功能的全域涵蓋範圍。 |
WebTestGeolocation[] (必要) |
名字 |
如果這個 WebTest,則為使用者定義的名稱。 |
字串 (必要) |
請求 |
要求屬性的集合 |
WebTestPropertiesRequest |
RetryEnabled |
如果此 WebTest 失敗,請允許重試。 |
bool |
SyntheticMonitorId |
此 WebTest 的唯一標識碼。 這通常與 [名稱] 欄位的值相同。 |
字串 (必要) |
超時 |
此 WebTest 逾時並失敗的秒數。 預設值為 30。 |
int |
ValidationRules |
驗證規則屬性的集合 |
WebTestPropertiesValidationRules |
WebTestPropertiesConfiguration
名字 |
描述 |
價值 |
WebTest |
要針對應用程式執行的 WebTest XML 規格。 |
字串 |
WebTestPropertiesRequest
名字 |
描述 |
價值 |
FollowRedirects |
請遵循此 Web 測試的重新導向。 |
bool |
頭 |
要新增至 WebTest 呼叫的標頭及其值清單。 |
HeaderField[] |
HttpVerb |
要用於此 Web 測試的 Http 動詞。 |
字串 |
ParseDependentRequests |
剖析此 WebTest 的相依要求。 |
bool |
RequestBody |
使用此 Web 測試傳送的 Base64 編碼字串主體。 |
字串 |
RequestUrl |
要測試的URL位置。 |
字串 |
WebTestPropertiesValidationRules
名字 |
描述 |
價值 |
ContentValidation |
內容驗證屬性的集合 |
WebTestPropertiesValidationRulesContentValidation |
ExpectedHttpStatusCode |
驗證 WebTest 是否傳回提供的 HTTP 狀態代碼。 |
int |
IgnoreHttpStatusCode |
設定時,驗證會忽略狀態代碼。 |
bool |
SSLCertRemainingLifetimeCheck |
在現有 SSL 憑證到期之前,仍要檢查的天數。 值必須是正數,且 SSLCheck 必須設定為 true。 |
int |
SSLCheck |
檢查 SSL 憑證是否仍然有效。 |
bool |
WebTestPropertiesValidationRulesContentValidation
名字 |
描述 |
價值 |
ContentMatch |
在 WebTest 傳回中要尋找的內容。 不得為 Null 或空白。 |
字串 |
IgnoreCase |
設定時,此值會使 ContentMatch 驗證案例不區分。 |
bool |
PassIfTextFound |
若為 true,如果 ContentMatch 字串相符,驗證將會通過。 如果為 false,如果相符項目,驗證將會失敗 |
bool |