你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Workspace Backend - Create Or Update
创建或更新后端。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/workspaces/{workspaceId}/backends/{backendId}?api-version=2024-05-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
backend
|
path | True |
string minLength: 1maxLength: 80 |
后端实体的标识符。 当前 API 管理服务实例中必须是唯一的。 |
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 名称不区分大小写。 |
service
|
path | True |
string minLength: 1maxLength: 50 pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$ |
API 管理服务的名称。 |
subscription
|
path | True |
string (uuid) |
目标订阅的 ID。 该值必须是 UUID。 |
workspace
|
path | True |
string minLength: 1maxLength: 80 pattern: ^[^*#&+:<>?]+$ |
工作区标识符。 当前 API 管理服务实例中必须是唯一的。 |
api-version
|
query | True |
string minLength: 1 |
用于此作的 API 版本。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
If-Match |
string |
实体的 ETag。 创建实体时不需要,但在更新实体时是必需的。 |
请求正文
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
properties.protocol | True |
后端通信协议。 |
|
properties.url | True |
string minLength: 1maxLength: 2000 |
后端的运行时 URL。 |
properties.circuitBreaker |
后端断路器配置 |
||
properties.credentials |
后端凭据协定属性 |
||
properties.description |
string minLength: 1maxLength: 2000 |
后端说明。 |
|
properties.pool | |||
properties.properties |
后端属性协定 |
||
properties.proxy |
后端网关协定属性 |
||
properties.resourceId |
string minLength: 1maxLength: 2000 |
外部系统中资源的管理 URI。 此 URL 可以是逻辑应用、函数应用或 API 应用的 Arm 资源 ID。 |
|
properties.title |
string minLength: 1maxLength: 300 |
后端标题。 |
|
properties.tls |
后端 TLS 属性 |
||
properties.type |
后端的类型。 后端可以是单一后端,也可以是池。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
已成功更新现有后端。 标头 ETag: string |
|
201 Created |
已成功创建后端。 标头 ETag: string |
|
Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
Api |
Api |
ApiManagementCreateWorkspaceBackendProxyBackend
示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/backends/proxybackend?api-version=2024-05-01
{
"properties": {
"description": "description5308",
"url": "https://backendname2644/",
"protocol": "http",
"tls": {
"validateCertificateChain": true,
"validateCertificateName": true
},
"proxy": {
"url": "http://192.168.1.1:8080",
"username": "Contoso\\admin",
"password": "<password>"
},
"credentials": {
"query": {
"sv": [
"xx",
"bb",
"cc"
]
},
"header": {
"x-my-1": [
"val1",
"val2"
]
},
"authorization": {
"scheme": "Basic",
"parameter": "opensesma"
}
}
}
}
示例响应
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/backends/proxybackend",
"type": "Microsoft.ApiManagement/service/workspaces/backends",
"name": "proxybackend",
"properties": {
"description": "description5308",
"url": "https://backendname2644/",
"protocol": "http",
"credentials": {
"query": {
"sv": [
"xx",
"bb",
"cc"
]
},
"header": {
"x-my-1": [
"val1",
"val2"
]
},
"authorization": {
"scheme": "Basic",
"parameter": "opensesma"
}
},
"proxy": {
"url": "http://192.168.1.1:8080",
"username": "Contoso\\admin",
"password": "<password>"
},
"tls": {
"validateCertificateChain": false,
"validateCertificateName": false
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/backends/proxybackend",
"type": "Microsoft.ApiManagement/service/workspaces/backends",
"name": "proxybackend",
"properties": {
"description": "description5308",
"url": "https://backendname2644/",
"protocol": "http",
"credentials": {
"query": {
"sv": [
"xx",
"bb",
"cc"
]
},
"header": {
"x-my-1": [
"val1",
"val2"
]
},
"authorization": {
"scheme": "Basic",
"parameter": "opensesma"
}
},
"proxy": {
"url": "http://192.168.1.1:8080",
"username": "Contoso\\admin",
"password": "<password>"
},
"tls": {
"validateCertificateChain": false,
"validateCertificateName": false
}
}
}
ApiManagementCreateWorkspaceBackendServiceFabric
示例请求
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/backends/sfbackend?api-version=2024-05-01
{
"properties": {
"description": "Service Fabric Test App 1",
"protocol": "http",
"url": "fabric:/mytestapp/mytestservice",
"properties": {
"serviceFabricCluster": {
"managementEndpoints": [
"https://somecluster.com"
],
"clientCertificateId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/certificates/cert1",
"serverX509Names": [
{
"name": "ServerCommonName1",
"issuerCertificateThumbprint": "IssuerCertificateThumbprint1"
}
],
"maxPartitionResolutionRetries": 5
}
}
}
}
示例响应
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/backends/sfbackend",
"type": "Microsoft.ApiManagement/service/workspaces/backends",
"name": "sfbackend",
"properties": {
"description": "Service Fabric Test App 1",
"url": "fabric:/mytestapp/mytestservice",
"protocol": "http",
"properties": {
"serviceFabricCluster": {
"managementEndpoints": [
"https://somecluster.com"
],
"clientCertificateId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/certificates/cert1",
"serverX509Names": [
{
"name": "ServerCommonName1",
"issuerCertificateThumbprint": "IssuerCertificateThumbprint1"
}
],
"maxPartitionResolutionRetries": 5
}
}
}
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/backends/sfbackend",
"type": "Microsoft.ApiManagement/service/workspaces/backends",
"name": "sfbackend",
"properties": {
"description": "Service Fabric Test App 1",
"url": "fabric:/mytestapp/mytestservice",
"protocol": "http",
"properties": {
"serviceFabricCluster": {
"managementEndpoints": [
"https://somecluster.com"
],
"clientCertificateId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/workspaces/wks1/certificates/cert1",
"serverX509Names": [
{
"name": "ServerCommonName1",
"issuerCertificateThumbprint": "IssuerCertificateThumbprint1"
}
],
"maxPartitionResolutionRetries": 5
}
}
}
}
定义
名称 | 说明 |
---|---|
Backend |
授权标头信息。 |
Backend |
后端断路器的配置 |
Backend |
后端详细信息。 |
Backend |
用于连接到后端的凭据的详细信息。 |
Backend |
后端池服务信息 |
Backend |
特定于后端类型的属性。 |
Backend |
后端通信协议。 |
Backend |
要用于后端请求的后端 WebProxy 服务器的详细信息。 |
Backend |
Service Fabric 类型后端的属性。 |
Backend |
控制 TLS 证书验证的属性。 |
Backend |
后端的类型。 后端可以是单一后端,也可以是池。 |
Circuit |
断路器的行程条件 |
Circuit |
用于行程后端的规则配置。 |
Error |
资源管理错误附加信息。 |
Error |
错误详细信息。 |
Error |
错误响应 |
Failure |
失败 http 状态代码范围 |
Pool | |
X509Certificate |
服务器 X509Names 的属性。 |
BackendAuthorizationHeaderCredentials
授权标头信息。
名称 | 类型 | 说明 |
---|---|---|
parameter |
string minLength: 1maxLength: 300 |
身份验证参数值。 |
scheme |
string minLength: 1maxLength: 100 |
身份验证方案名称。 |
BackendCircuitBreaker
后端断路器的配置
名称 | 类型 | 说明 |
---|---|---|
rules |
用于行程后端的规则。 |
BackendContract
后端详细信息。
名称 | 类型 | 说明 |
---|---|---|
id |
string |
资源的完全限定资源 ID。 Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
name |
string |
资源的名称 |
properties.circuitBreaker |
后端断路器配置 |
|
properties.credentials |
后端凭据协定属性 |
|
properties.description |
string minLength: 1maxLength: 2000 |
后端说明。 |
properties.pool | ||
properties.properties |
后端属性协定 |
|
properties.protocol |
后端通信协议。 |
|
properties.proxy |
后端网关协定属性 |
|
properties.resourceId |
string minLength: 1maxLength: 2000 |
外部系统中资源的管理 URI。 此 URL 可以是逻辑应用、函数应用或 API 应用的 Arm 资源 ID。 |
properties.title |
string minLength: 1maxLength: 300 |
后端标题。 |
properties.tls |
后端 TLS 属性 |
|
properties.type |
后端的类型。 后端可以是单一后端,也可以是池。 |
|
properties.url |
string minLength: 1maxLength: 2000 |
后端的运行时 URL。 |
type |
string |
资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
BackendCredentialsContract
用于连接到后端的凭据的详细信息。
名称 | 类型 | 说明 |
---|---|---|
authorization |
授权标头身份验证 |
|
certificate |
string[] |
客户端证书指纹列表。 如果提供了 certificatesIds,则将被忽略。 |
certificateIds |
string[] |
客户端证书 ID 的列表。 |
header |
object |
标头参数说明。 |
query |
object |
查询参数说明。 |
BackendPoolItem
后端池服务信息
名称 | 类型 | 说明 |
---|---|---|
id |
string (arm-id) |
后端实体的唯一 ARM ID。 ARM ID 应引用已存在的后端实体。 |
priority |
integer (int32) minimum: 0maximum: 100 |
后端池中后端实体的优先级。 必须介于 0 和 100 之间。 如果未指定值,也可以为 null。 |
weight |
integer (int32) minimum: 0maximum: 100 |
后端池中后端实体的权重。 必须介于 0 和 100 之间。 如果未指定值,也可以为 null。 |
BackendProperties
特定于后端类型的属性。
名称 | 类型 | 说明 |
---|---|---|
serviceFabricCluster |
后端 Service Fabric 群集属性 |
BackendProtocol
后端通信协议。
值 | 说明 |
---|---|
http |
后端是 RESTful 服务。 |
soap |
后端是 SOAP 服务。 |
BackendProxyContract
要用于后端请求的后端 WebProxy 服务器的详细信息。
名称 | 类型 | 说明 |
---|---|---|
password |
string |
连接到 WebProxy 服务器的密码 |
url |
string minLength: 1maxLength: 2000 |
WebProxy Server AbsoluteUri 属性,其中包括存储在 Uri 实例中的整个 URI,包括所有片段和查询字符串。 |
username |
string |
连接到 WebProxy 服务器的用户名 |
BackendServiceFabricClusterProperties
Service Fabric 类型后端的属性。
名称 | 类型 | 说明 |
---|---|---|
clientCertificateId |
string |
管理终结点的客户端证书 ID。 |
clientCertificatethumbprint |
string |
管理终结点的客户端证书指纹。 如果提供了 certificatesIds,将忽略 |
managementEndpoints |
string[] |
群集管理终结点。 |
maxPartitionResolutionRetries |
integer (int32) |
尝试解析分区时的最大重试次数。 |
serverCertificateThumbprints |
string[] |
群集管理服务用于 tls 通信的证书指纹 |
serverX509Names |
服务器 X509 证书名称集合 |
BackendTlsProperties
控制 TLS 证书验证的属性。
名称 | 类型 | 默认值 | 说明 |
---|---|---|---|
validateCertificateChain |
boolean |
True |
指示在此后端主机使用自签名证书时是否应执行 SSL 证书链验证的标志。 |
validateCertificateName |
boolean |
True |
指示在此后端主机使用自签名证书时是否应执行 SSL 证书名称验证的标志。 |
BackendType
后端的类型。 后端可以是单一后端,也可以是池。
值 | 说明 |
---|---|
Pool |
支持池后端 |
Single |
支持单个后端 |
CircuitBreakerFailureCondition
断路器的行程条件
名称 | 类型 | 说明 |
---|---|---|
count |
integer (int64) |
打开线路的阈值。 |
errorReasons |
string[] maxLength: 200 |
被视为失败的错误原因。 |
interval |
string (duration) |
计算失败的间隔。 |
percentage |
integer (int64) |
打开线路的阈值。 |
statusCodeRanges |
被视为失败的状态代码范围。 |
CircuitBreakerRule
用于行程后端的规则配置。
名称 | 类型 | 说明 |
---|---|---|
acceptRetryAfter |
boolean |
从后端接受 Retry-After 标头的标志。 |
failureCondition |
断路器的行程条件。 |
|
name |
string |
规则名称。 |
tripDuration |
string (duration) |
线路将被绊倒的持续时间。 |
ErrorAdditionalInfo
资源管理错误附加信息。
名称 | 类型 | 说明 |
---|---|---|
info |
object |
其他信息。 |
type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
名称 | 类型 | 说明 |
---|---|---|
additionalInfo |
错误附加信息。 |
|
code |
string |
错误代码。 |
details |
错误详细信息。 |
|
message |
string |
错误消息。 |
target |
string |
错误目标。 |
ErrorResponse
错误响应
名称 | 类型 | 说明 |
---|---|---|
error |
错误对象。 |
FailureStatusCodeRange
失败 http 状态代码范围
名称 | 类型 | 说明 |
---|---|---|
max |
integer (int32) minimum: 200maximum: 599 |
最大 http 状态代码。 |
min |
integer (int32) minimum: 200maximum: 599 |
最低 http 状态代码。 |
Pool
名称 | 类型 | 说明 |
---|---|---|
services |
属于池的后端实体的列表。 |
X509CertificateName
服务器 X509Names 的属性。
名称 | 类型 | 说明 |
---|---|---|
issuerCertificateThumbprint |
string |
证书颁发者的指纹。 |
name |
string |
证书的公用名。 |