Microsoft.Insights Webtests

Bicep 資源定義

Webtests 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

資源格式

若要建立 Microsoft.Insights/webtests 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Insights/webtests@2022-06-15' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  kind: '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
    }
  }
}

屬性值

webtests

名稱 描述
NAME 資源名稱 需要字串 ()
location 資源位置 需要字串 ()
tags 資源標籤 標記名稱和值的字典。 請參閱 範本中的標籤
kind 此 Web 測試所監看的 WebTest 種類。 選擇為 ping、multistep 和 standard。 'multistep'
'ping'
'standard'
properties 描述 Azure 資源的 Web 測試的中繼資料。 WebTestProperties

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 規格。 字串

WebTestGeolocation

名稱 描述
識別碼 要從中執行之 WebTest 的位置識別碼。 字串

WebTestPropertiesRequest

名稱 描述
FollowRedirects 請遵循此 Web 測試的重新導向。 bool
標題 要新增至 WebTest 呼叫的標頭及其值清單。 HeaderField[]
HttpVerb 要用於此 Web 測試的 Http 動詞。 字串
ParseDependentRequests 剖析此 WebTest 的相依要求。 bool
RequestBody 以此 Web 測試傳送的 Base64 編碼字串本文。 字串
RequestUrl 要測試的 URL 位置。 字串

HeaderField

名稱 描述
索引鍵 標頭的名稱。 字串
value 標頭的值。 字串

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

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
動態 Web 測試建立

部署至 Azure
建立任意數目的 App Insights Web (ping) 測試。
可用性測試的計量警示規則

部署至 Azure
此範本會建立 Application Insights 可用性測試,以及監視它的計量警示規則。

ARM 範本資源定義

Webtests 資源類型可以使用目標作業進行部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄

資源格式

若要建立 Microsoft.Insights/webtests 資源,請將下列 JSON 新增至您的範本。

{
  "type": "Microsoft.Insights/webtests",
  "apiVersion": "2022-06-15",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "kind": "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"
    }
  }
}

屬性值

webtests

名稱 描述
類型 資源類型 'Microsoft.Insights/webtests'
apiVersion 資源 API 版本 '2022-06-15'
NAME 資源名稱 字串 (必要)
location 資源位置 字串 (必要)
tags 資源標籤 標記名稱和值的字典。 請參閱 範本中的標記
kind 此 Web 測試所監看的 WebTest 種類。 選擇是 Ping、多步驟和標準。 'multistep'
'ping'
'standard'
properties 描述 Azure 資源的 Web 測試的中繼資料。 WebTestProperties

WebTestProperties

名稱 描述
組態 WebTest 的 XML 組態規格。 WebTestPropertiesConfiguration
描述 此 WebTest 的使用者定義描述。 字串
啟用 是否正在主動監視測試。 bool
頻率 此 WebTest 的測試回合之間以秒為單位的間隔。 預設值為 300。 int
種類 這是 Web 測試的類型,有效的選擇是 ping、多步驟和標準。 'multistep'
'ping'
必要的 'standard' ()
位置 實際執行測試的來源清單,以提供應用程式協助工具的全域涵蓋範圍。 WebTestGeolocation[] (必要)
名稱 如果使用者定義名稱,則為這個 WebTest。 字串 (必要)
要求 要求屬性的集合 WebTestPropertiesRequest
RetryEnabled 允許重試此 WebTest 失敗。 bool
SyntheticMonitorId 此 WebTest 的唯一識別碼。 這通常與 [名稱] 欄位相同。 字串 (必要)
逾時 此 WebTest 的逾時和失敗前的秒數。 預設值為 30。 int
ValidationRules 驗證規則屬性的集合 WebTestPropertiesValidationRules

WebTestPropertiesConfiguration

名稱 描述
WebTest 要針對應用程式執行的 WebTest XML 規格。 字串

WebTestGeolocation

名稱 描述
識別碼 要從中執行之 WebTest 的位置識別碼。 字串

WebTestPropertiesRequest

名稱 描述
FollowRedirects 請遵循此 Web 測試的重新導向。 bool
標題 要新增至 WebTest 呼叫的標頭及其值清單。 HeaderField[]
HttpVerb 要用於此 Web 測試的 Http 動詞。 字串
ParseDependentRequests 剖析此 WebTest 的相依要求。 bool
RequestBody 以此 Web 測試傳送的 Base64 編碼字串本文。 字串
RequestUrl 要測試的 URL 位置。 字串

HeaderField

名稱 描述
索引鍵 標頭的名稱。 字串
value 標頭的值。 字串

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

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
動態 Web 測試建立

部署至 Azure
建立任意數目的 App Insights Web (ping) 測試。
可用性測試的計量警示規則

部署至 Azure
此範本會建立 Application Insights 可用性測試,以及監視它的計量警示規則。

Terraform (AzAPI 提供者) 資源定義

Webtests 資源類型可以使用目標作業來部署:

  • 資源群組

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

資源格式

若要建立 Microsoft.Insights/webtests 資源,請將下列 Terraform 新增至您的範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Insights/webtests@2022-06-15"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  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
      }
    }
    kind = "string"
  })
}

屬性值

webtests

名稱 描述
類型 資源類型 「Microsoft.Insights/webtests@2022-06-15」
NAME 資源名稱 需要字串 ()
location 資源位置 需要字串 ()
parent_id 若要部署至資源群組,請使用該資源群組的識別碼。 需要字串 ()
tags 資源標籤 標記名稱和值的字典。
kind 此 Web 測試所監看的 WebTest 種類。 選擇為 ping、multistep 和 standard。 「multistep」
「ping」
「standard」
properties 描述 Azure 資源的 Web 測試的中繼資料。 WebTestProperties

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 規格。 字串

WebTestGeolocation

名稱 描述
識別碼 要從中執行之 WebTest 的位置識別碼。 字串

WebTestPropertiesRequest

名稱 描述
FollowRedirects 請遵循此 Web 測試的重新導向。 bool
標題 要新增至 WebTest 呼叫的標頭及其值清單。 HeaderField[]
HttpVerb 要用於此 Web 測試的 Http 動詞。 字串
ParseDependentRequests 剖析此 WebTest 的相依要求。 bool
RequestBody 要與此 Web 測試一起傳送的 Base64 編碼字串本文。 字串
RequestUrl 要測試的 URL 位置。 字串

HeaderField

名稱 描述
索引鍵 標頭的名稱。 字串
value 標頭的值。 字串

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