共用方式為


Microsoft.App containerApps/resiliencyPolicies

Bicep 資源定義

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

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

資源格式

若要建立 Microsoft.App/containerApps/resiliencyPolicies 資源,請將下列 Bicep 新增至您的範本。

resource symbolicname 'Microsoft.App/containerApps/resiliencyPolicies@2024-10-02-preview' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    circuitBreakerPolicy: {
      consecutiveErrors: int
      intervalInSeconds: int
      maxEjectionPercent: int
    }
    httpConnectionPool: {
      http1MaxPendingRequests: int
      http2MaxRequests: int
    }
    httpRetryPolicy: {
      matches: {
        errors: [
          'string'
        ]
        headers: [
          {
            header: 'string'
            match: {
              exactMatch: 'string'
              prefixMatch: 'string'
              regexMatch: 'string'
              suffixMatch: 'string'
            }
          }
        ]
        httpStatusCodes: [
          int
        ]
      }
      maxRetries: int
      retryBackOff: {
        initialDelayInMilliseconds: int
        maxIntervalInMilliseconds: int
      }
    }
    tcpConnectionPool: {
      maxConnections: int
    }
    tcpRetryPolicy: {
      maxConnectAttempts: int
    }
    timeoutPolicy: {
      connectionTimeoutInSeconds: int
      responseTimeoutInSeconds: int
    }
  }
}

屬性值

AppResiliencyProperties

名字 描述 價值
circuitBreakerPolicy 定義斷路器條件的原則 CircuitBreakerPolicy
httpConnectionPool 定義 HTTP 連線共用的參數 HttpConnectionPool
httpRetryPolicy 定義 HTTP 要求重試條件的原則 HttpRetryPolicy
tcpConnectionPool 定義 tcp 連線共用的參數 TcpConnectionPool
tcpRetryPolicy 定義 tcp 要求重試條件的原則 TcpRetryPolicy
timeoutPolicy 設定要求逾時的原則 TimeoutPolicy

CircuitBreakerPolicy

名字 描述 價值
consecutiveErrors 斷路器開啟之前的連續錯誤數目 int
intervalInSeconds 端點檢查之間的時間間隔,以秒為單位。 如果檢查失敗,以及如果檢查成功,關閉斷路器,這可能會導致開啟斷路器。 預設值為 10s。 int
maxEjectionPercent 符合失敗閾值後將會退出的主機百分比上限 int

HeaderMatch

名字 描述 價值
頁眉 標頭的名稱 字串
火柴 要執行的比對類型 HeaderMatchMatch

HeaderMatchMatch

名字 描述 價值
exactMatch 標頭的確切值 字串
prefixMatch 標頭的前置詞值 字串
regexMatch 標頭的 Regex 值 字串
suffixMatch 標頭的後綴值 字串

HttpConnectionPool

名字 描述 價值
http1MaxPendingRequests 允許的暫止 HTTP1 要求數目上限 int
http2MaxRequests 允許的 HTTP2 要求數目上限 int

HttpRetryPolicy

名字 描述 價值
比賽 必須符合才能重試要求的條件 HttpRetryPolicyMatches
maxRetries 要求重試的次數上限 int
retryBackOff 重試輪詢特性的設定 HttpRetryPolicyRetryBackOff

HttpRetryPolicyMatches

名字 描述 價值
錯誤 可以觸發重試的錯誤 string[]
必須存在的標頭,才能重試要求 HeaderMatch[]
httpStatusCodes 可觸發重試的其他 HTTP 狀態代碼 int[]

HttpRetryPolicyRetryBackOff

名字 描述 價值
initialDelayInMilliseconds 在重試要求之前,以毫秒為單位的初始延遲 int
maxIntervalInMilliseconds 重試之間的間隔上限,以毫秒為單位 int

Microsoft.App/containerApps/resiliencyPolicies

名字 描述 價值
名字 資源名稱 字串

約束:
模式 = ^[-\w\._\(\)]+$ (必要)
父母 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。

如需詳細資訊,請參閱 父資源外部的子資源
類型的資源符號名稱:containerApps
性能 應用程式復原資源特定屬性 AppResiliencyProperties

TcpConnectionPool

名字 描述 價值
maxConnections 允許的 TCP 連線數目上限 int

TcpRetryPolicy

名字 描述 價值
maxConnectAttempts 線上到 tcp 服務的嘗試次數上限 int

TimeoutPolicy

名字 描述 價值
connectionTimeoutInSeconds 逾時,以秒為單位,要求起始連接 int
responseTimeoutInSeconds 要求回應的逾時,以秒為單位 int

ARM 樣本資源定義

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

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

資源格式

若要建立 Microsoft.App/containerApps/resiliencyPolicies 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.App/containerApps/resiliencyPolicies",
  "apiVersion": "2024-10-02-preview",
  "name": "string",
  "properties": {
    "circuitBreakerPolicy": {
      "consecutiveErrors": "int",
      "intervalInSeconds": "int",
      "maxEjectionPercent": "int"
    },
    "httpConnectionPool": {
      "http1MaxPendingRequests": "int",
      "http2MaxRequests": "int"
    },
    "httpRetryPolicy": {
      "matches": {
        "errors": [ "string" ],
        "headers": [
          {
            "header": "string",
            "match": {
              "exactMatch": "string",
              "prefixMatch": "string",
              "regexMatch": "string",
              "suffixMatch": "string"
            }
          }
        ],
        "httpStatusCodes": [ "int" ]
      },
      "maxRetries": "int",
      "retryBackOff": {
        "initialDelayInMilliseconds": "int",
        "maxIntervalInMilliseconds": "int"
      }
    },
    "tcpConnectionPool": {
      "maxConnections": "int"
    },
    "tcpRetryPolicy": {
      "maxConnectAttempts": "int"
    },
    "timeoutPolicy": {
      "connectionTimeoutInSeconds": "int",
      "responseTimeoutInSeconds": "int"
    }
  }
}

屬性值

AppResiliencyProperties

名字 描述 價值
circuitBreakerPolicy 定義斷路器條件的原則 CircuitBreakerPolicy
httpConnectionPool 定義 HTTP 連線共用的參數 HttpConnectionPool
httpRetryPolicy 定義 HTTP 要求重試條件的原則 HttpRetryPolicy
tcpConnectionPool 定義 tcp 連線共用的參數 TcpConnectionPool
tcpRetryPolicy 定義 tcp 要求重試條件的原則 TcpRetryPolicy
timeoutPolicy 設定要求逾時的原則 TimeoutPolicy

CircuitBreakerPolicy

名字 描述 價值
consecutiveErrors 斷路器開啟之前的連續錯誤數目 int
intervalInSeconds 端點檢查之間的時間間隔,以秒為單位。 如果檢查失敗,以及如果檢查成功,關閉斷路器,這可能會導致開啟斷路器。 預設值為 10s。 int
maxEjectionPercent 符合失敗閾值後將會退出的主機百分比上限 int

HeaderMatch

名字 描述 價值
頁眉 標頭的名稱 字串
火柴 要執行的比對類型 HeaderMatchMatch

HeaderMatchMatch

名字 描述 價值
exactMatch 標頭的確切值 字串
prefixMatch 標頭的前置詞值 字串
regexMatch 標頭的 Regex 值 字串
suffixMatch 標頭的後綴值 字串

HttpConnectionPool

名字 描述 價值
http1MaxPendingRequests 允許的暫止 HTTP1 要求數目上限 int
http2MaxRequests 允許的 HTTP2 要求數目上限 int

HttpRetryPolicy

名字 描述 價值
比賽 必須符合才能重試要求的條件 HttpRetryPolicyMatches
maxRetries 要求重試的次數上限 int
retryBackOff 重試輪詢特性的設定 HttpRetryPolicyRetryBackOff

HttpRetryPolicyMatches

名字 描述 價值
錯誤 可以觸發重試的錯誤 string[]
必須存在的標頭,才能重試要求 HeaderMatch[]
httpStatusCodes 可觸發重試的其他 HTTP 狀態代碼 int[]

HttpRetryPolicyRetryBackOff

名字 描述 價值
initialDelayInMilliseconds 在重試要求之前,以毫秒為單位的初始延遲 int
maxIntervalInMilliseconds 重試之間的間隔上限,以毫秒為單位 int

Microsoft.App/containerApps/resiliencyPolicies

名字 描述 價值
apiVersion API 版本 '2024-10-02-preview'
名字 資源名稱 字串

約束:
模式 = ^[-\w\._\(\)]+$ (必要)
性能 應用程式復原資源特定屬性 AppResiliencyProperties
類型 資源類型 'Microsoft.App/containerApps/resiliencyPolicies'

TcpConnectionPool

名字 描述 價值
maxConnections 允許的 TCP 連線數目上限 int

TcpRetryPolicy

名字 描述 價值
maxConnectAttempts 線上到 tcp 服務的嘗試次數上限 int

TimeoutPolicy

名字 描述 價值
connectionTimeoutInSeconds 逾時,以秒為單位,要求起始連接 int
responseTimeoutInSeconds 要求回應的逾時,以秒為單位 int

Terraform (AzAPI 提供者) 資源定義

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

  • 資源群組

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

資源格式

若要建立 Microsoft.App/containerApps/resiliencyPolicies 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.App/containerApps/resiliencyPolicies@2024-10-02-preview"
  name = "string"
  body = jsonencode({
    properties = {
      circuitBreakerPolicy = {
        consecutiveErrors = int
        intervalInSeconds = int
        maxEjectionPercent = int
      }
      httpConnectionPool = {
        http1MaxPendingRequests = int
        http2MaxRequests = int
      }
      httpRetryPolicy = {
        matches = {
          errors = [
            "string"
          ]
          headers = [
            {
              header = "string"
              match = {
                exactMatch = "string"
                prefixMatch = "string"
                regexMatch = "string"
                suffixMatch = "string"
              }
            }
          ]
          httpStatusCodes = [
            int
          ]
        }
        maxRetries = int
        retryBackOff = {
          initialDelayInMilliseconds = int
          maxIntervalInMilliseconds = int
        }
      }
      tcpConnectionPool = {
        maxConnections = int
      }
      tcpRetryPolicy = {
        maxConnectAttempts = int
      }
      timeoutPolicy = {
        connectionTimeoutInSeconds = int
        responseTimeoutInSeconds = int
      }
    }
  })
}

屬性值

AppResiliencyProperties

名字 描述 價值
circuitBreakerPolicy 定義斷路器條件的原則 CircuitBreakerPolicy
httpConnectionPool 定義 HTTP 連線共用的參數 HttpConnectionPool
httpRetryPolicy 定義 HTTP 要求重試條件的原則 HttpRetryPolicy
tcpConnectionPool 定義 tcp 連線共用的參數 TcpConnectionPool
tcpRetryPolicy 定義 tcp 要求重試條件的原則 TcpRetryPolicy
timeoutPolicy 設定要求逾時的原則 TimeoutPolicy

CircuitBreakerPolicy

名字 描述 價值
consecutiveErrors 斷路器開啟之前的連續錯誤數目 int
intervalInSeconds 端點檢查之間的時間間隔,以秒為單位。 如果檢查失敗,以及如果檢查成功,關閉斷路器,這可能會導致開啟斷路器。 預設值為 10s。 int
maxEjectionPercent 符合失敗閾值後將會退出的主機百分比上限 int

HeaderMatch

名字 描述 價值
頁眉 標頭的名稱 字串
火柴 要執行的比對類型 HeaderMatchMatch

HeaderMatchMatch

名字 描述 價值
exactMatch 標頭的確切值 字串
prefixMatch 標頭的前置詞值 字串
regexMatch 標頭的 Regex 值 字串
suffixMatch 標頭的後綴值 字串

HttpConnectionPool

名字 描述 價值
http1MaxPendingRequests 允許的暫止 HTTP1 要求數目上限 int
http2MaxRequests 允許的 HTTP2 要求數目上限 int

HttpRetryPolicy

名字 描述 價值
比賽 必須符合才能重試要求的條件 HttpRetryPolicyMatches
maxRetries 要求重試的次數上限 int
retryBackOff 重試輪詢特性的設定 HttpRetryPolicyRetryBackOff

HttpRetryPolicyMatches

名字 描述 價值
錯誤 可以觸發重試的錯誤 string[]
必須存在的標頭,才能重試要求 HeaderMatch[]
httpStatusCodes 可觸發重試的其他 HTTP 狀態代碼 int[]

HttpRetryPolicyRetryBackOff

名字 描述 價值
initialDelayInMilliseconds 在重試要求之前,以毫秒為單位的初始延遲 int
maxIntervalInMilliseconds 重試之間的間隔上限,以毫秒為單位 int

Microsoft.App/containerApps/resiliencyPolicies

名字 描述 價值
名字 資源名稱 字串

約束:
模式 = ^[-\w\._\(\)]+$ (必要)
parent_id 此資源為父系之資源的標識碼。 類型資源的標識碼:containerApps
性能 應用程式復原資源特定屬性 AppResiliencyProperties
類型 資源類型 “Microsoft.App/containerApps/resiliencyPolicies@2024-10-02-preview”

TcpConnectionPool

名字 描述 價值
maxConnections 允許的 TCP 連線數目上限 int

TcpRetryPolicy

名字 描述 價值
maxConnectAttempts 線上到 tcp 服務的嘗試次數上限 int

TimeoutPolicy

名字 描述 價值
connectionTimeoutInSeconds 逾時,以秒為單位,要求起始連接 int
responseTimeoutInSeconds 要求回應的逾時,以秒為單位 int