App Resiliency - List
列出应用程序的复原策略。
列出容器应用复原策略。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{appName}/resiliencyPolicies?api-version=2025-02-02-preview
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
app
|
path | True |
string pattern: ^[-\w\._\(\)]+$ |
容器应用的名称。 |
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
subscription
|
path | True |
string (uuid) |
目标订阅的 ID。 该值必须是 UUID。 |
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
好的 |
|
Other Status Codes |
常见的错误响应。 |
示例
List App Resiliency
示例请求
GET https://management.azure.com/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0/resiliencyPolicies?api-version=2025-02-02-preview
示例响应
{
"value": [
{
"id": "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/containerApps/testcontainerApp0/resiliencyPolicies/resiliency-policy-1",
"name": "resiliency-policy-1",
"type": "Microsoft.App/containerApps/resiliencyPolicies",
"properties": {
"timeoutPolicy": {
"responseTimeoutInSeconds": 15,
"connectionTimeoutInSeconds": 5
},
"httpRetryPolicy": {
"maxRetries": 5,
"retryBackOff": {
"initialDelayInMilliseconds": 1000,
"maxIntervalInMilliseconds": 10000
},
"matches": {
"headers": [
{
"header": "X-Content-Type",
"match": {
"prefixMatch": "GOATS"
}
}
],
"httpStatusCodes": [
502,
503
],
"errors": [
"5xx",
"connect-failure",
"reset",
"retriable-headers",
"retriable-status-codes"
]
}
},
"tcpRetryPolicy": {
"maxConnectAttempts": 3
},
"circuitBreakerPolicy": {
"consecutiveErrors": 5,
"intervalInSeconds": 10,
"maxEjectionPercent": 50
},
"tcpConnectionPool": {
"maxConnections": 100
},
"httpConnectionPool": {
"http1MaxPendingRequests": 1024,
"http2MaxRequests": 1024
}
}
}
]
}
定义
名称 | 说明 |
---|---|
App |
用于设置应用复原能力的配置 |
App |
AppResiliency 策略的集合 |
Circuit |
定义断路器条件的策略 |
created |
创建资源的标识的类型。 |
Default |
应用服务错误响应。 |
Details |
详细信息或错误 |
Error |
错误模型。 |
Header |
匹配标头所需的条件 |
Http |
定义 http 连接池的参数 |
system |
与创建和上次修改资源相关的元数据。 |
Tcp |
定义 tcp 连接池的参数 |
Tcp |
定义 tcp 请求重试条件的策略 |
Timeout |
设置请求超时的策略 |
AppResiliency
用于设置应用复原能力的配置
名称 | 类型 | 说明 |
---|---|---|
id |
string (arm-id) |
资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
name |
string |
资源的名称 |
properties.circuitBreakerPolicy |
定义断路器条件的策略 |
|
properties.httpConnectionPool |
定义 http 连接池的参数 |
|
properties.httpRetryPolicy.matches.errors |
string[] |
可以触发重试的错误 |
properties.httpRetryPolicy.matches.headers |
必须存在才能重试请求的标头 |
|
properties.httpRetryPolicy.matches.httpStatusCodes |
integer[] (int32) |
可以触发重试的其他 http 状态代码 |
properties.httpRetryPolicy.maxRetries |
integer (int32) |
请求重试的最大次数 |
properties.httpRetryPolicy.retryBackOff.initialDelayInMilliseconds |
integer (int64) |
在重试请求之前的初始延迟(以毫秒为单位) |
properties.httpRetryPolicy.retryBackOff.maxIntervalInMilliseconds |
integer (int64) |
重试之间的最大间隔(以毫秒为单位) |
properties.tcpConnectionPool |
定义 tcp 连接池的参数 |
|
properties.tcpRetryPolicy |
定义 tcp 请求重试条件的策略 |
|
properties.timeoutPolicy |
设置请求超时的策略 |
|
systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
type |
string |
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
AppResiliencyCollection
AppResiliency 策略的集合
名称 | 类型 | 说明 |
---|---|---|
nextLink |
string |
链接到下一页的资源。 |
value |
资源集合。 |
CircuitBreakerPolicy
定义断路器条件的策略
名称 | 类型 | 说明 |
---|---|---|
consecutiveErrors |
integer (int32) |
断路器打开前的连续错误数 |
intervalInSeconds |
integer (int32) |
终结点检查之间的时间间隔(以秒为单位)。 如果检查失败,并关闭断路器(如果检查成功),则可能会导致打开断路器。 默认值为 10s。 |
maxEjectionPercent |
integer (int32) |
满足故障阈值后将弹出的主机的最大百分比 |
createdByType
创建资源的标识的类型。
值 | 说明 |
---|---|
Application | |
Key | |
ManagedIdentity | |
User |
DefaultErrorResponse
应用服务错误响应。
名称 | 类型 | 说明 |
---|---|---|
error |
错误模型。 |
Details
详细信息或错误
名称 | 类型 | 说明 |
---|---|---|
code |
string |
标准化字符串,以编程方式标识错误。 |
message |
string |
详细的错误说明和调试信息。 |
target |
string |
详细的错误说明和调试信息。 |
Error
错误模型。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
标准化字符串,以编程方式标识错误。 |
details |
Details[] |
详细信息或错误 |
innererror |
string |
调试错误的详细信息。 |
message |
string |
详细的错误说明和调试信息。 |
target |
string |
详细的错误说明和调试信息。 |
HeaderMatch
匹配标头所需的条件
名称 | 类型 | 说明 |
---|---|---|
header |
string |
标头的名称 |
match.exactMatch |
string |
标头的精确值 |
match.prefixMatch |
string |
标头的前缀值 |
match.regexMatch |
string |
标头的正则表达式值 |
match.suffixMatch |
string |
标头的后缀值 |
HttpConnectionPool
定义 http 连接池的参数
名称 | 类型 | 说明 |
---|---|---|
http1MaxPendingRequests |
integer (int32) |
允许的最大挂起 http1 请求数 |
http2MaxRequests |
integer (int32) |
允许的最大 http2 请求数 |
systemData
与创建和上次修改资源相关的元数据。
名称 | 类型 | 说明 |
---|---|---|
createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
createdBy |
string |
创建资源的标识。 |
createdByType |
创建资源的标识的类型。 |
|
lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
lastModifiedBy |
string |
上次修改资源的标识。 |
lastModifiedByType |
上次修改资源的标识的类型。 |
TcpConnectionPool
定义 tcp 连接池的参数
名称 | 类型 | 说明 |
---|---|---|
maxConnections |
integer (int32) |
允许的最大 tcp 连接数 |
TcpRetryPolicy
定义 tcp 请求重试条件的策略
名称 | 类型 | 说明 |
---|---|---|
maxConnectAttempts |
integer (int32) |
连接到 tcp 服务的最大尝试次数 |
TimeoutPolicy
设置请求超时的策略
名称 | 类型 | 说明 |
---|---|---|
connectionTimeoutInSeconds |
integer (int32) |
请求启动连接时超时(以秒为单位) |
responseTimeoutInSeconds |
integer (int32) |
请求响应的超时(以秒为单位) |