你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Broker Authentication - Create Or Update

创建 BrokerAuthenticationResource

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.IoTOperations/instances/{instanceName}/brokers/{brokerName}/authentications/{authenticationName}?api-version=2025-10-01

URI 参数

名称 必需 类型 说明
authenticationName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$

实例代理身份验证资源的名称

brokerName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$

中转站的名称。

instanceName
path True

string

minLength: 3
maxLength: 63
pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$

实例的名称。

resourceGroupName
path True

string

minLength: 1
maxLength: 90

资源组的名称。 此名称不区分大小写。

subscriptionId
path True

string (uuid)

目标订阅的 ID。 该值必须是 UUID。

api-version
query True

string

minLength: 1

要用于此操作的 API 版本。

请求正文

名称 类型 说明
extendedLocation

ExtendedLocation

资源的边缘位置。

properties

BrokerAuthenticationProperties

此资源的资源特定属性。

响应

名称 类型 说明
200 OK

BrokerAuthenticationResource

资源“BrokerAuthenticationResource”更新作成功

201 Created

BrokerAuthenticationResource

资源“BrokerAuthenticationResource”创建作成功

标头

  • Azure-AsyncOperation: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

意外的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

类型: oauth2
流向: implicit
授权 URL: https://login.microsoftonline.com/common/oauth2/authorize

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

BrokerAuthentication_CreateOrUpdate
BrokerAuthentication_CreateOrUpdate_Complex

BrokerAuthentication_CreateOrUpdate

示例请求

PUT https://management.azure.com/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123?api-version=2025-10-01

{
  "properties": {
    "authenticationMethods": [
      {
        "method": "Custom",
        "customSettings": {
          "auth": {
            "x509": {
              "secretRef": "secret-name"
            }
          },
          "caCertConfigMap": "pdecudefqyolvncbus",
          "endpoint": "https://www.example.com",
          "headers": {
            "key8518": "bwityjy"
          }
        },
        "serviceAccountTokenSettings": {
          "audiences": [
            "jqyhyqatuydg"
          ]
        },
        "x509Settings": {
          "authorizationAttributes": {
            "key3384": {
              "attributes": {
                "key186": "ucpajramsz"
              },
              "subject": "jpgwctfeixitptfgfnqhua"
            }
          },
          "trustedClientCaCert": "vlctsqddl"
        }
      }
    ]
  },
  "extendedLocation": {
    "name": "/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.ExtendedLocation/customLocations/resource-123",
    "type": "CustomLocation"
  }
}

示例响应

{
  "properties": {
    "authenticationMethods": [
      {
        "method": "Custom",
        "customSettings": {
          "auth": {
            "x509": {
              "secretRef": "secret-name"
            }
          },
          "caCertConfigMap": "pdecudefqyolvncbus",
          "endpoint": "https://www.example.com",
          "headers": {
            "key8518": "bwityjy"
          }
        },
        "serviceAccountTokenSettings": {
          "audiences": [
            "jqyhyqatuydg"
          ]
        },
        "x509Settings": {
          "authorizationAttributes": {
            "key3384": {
              "attributes": {
                "key186": "ucpajramsz"
              },
              "subject": "jpgwctfeixitptfgfnqhua"
            }
          },
          "trustedClientCaCert": "vlctsqddl"
        }
      }
    ],
    "provisioningState": "Succeeded"
  },
  "extendedLocation": {
    "name": "/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.ExtendedLocation/customLocations/resource-123",
    "type": "CustomLocation"
  },
  "id": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123",
  "name": "lwucizfvtsdpx",
  "type": "Microsoft.IoTOperations/instances/brokers/authentications",
  "systemData": {
    "createdBy": "contosouser",
    "createdByType": "User",
    "createdAt": "2024-08-09T18:13:29.389Z",
    "lastModifiedBy": "contosouser",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-08-09T18:13:29.389Z"
  }
}
Azure-AsyncOperation: https://contoso.com/operationstatus
{
  "properties": {
    "authenticationMethods": [
      {
        "method": "Custom",
        "customSettings": {
          "auth": {
            "x509": {
              "secretRef": "secret-name"
            }
          },
          "caCertConfigMap": "pdecudefqyolvncbus",
          "endpoint": "https://www.example.com",
          "headers": {
            "key8518": "bwityjy"
          }
        },
        "serviceAccountTokenSettings": {
          "audiences": [
            "jqyhyqatuydg"
          ]
        },
        "x509Settings": {
          "authorizationAttributes": {
            "key3384": {
              "attributes": {
                "key186": "ucpajramsz"
              },
              "subject": "jpgwctfeixitptfgfnqhua"
            }
          },
          "trustedClientCaCert": "vlctsqddl"
        }
      }
    ],
    "provisioningState": "Succeeded"
  },
  "extendedLocation": {
    "name": "/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.ExtendedLocation/customLocations/resource-123",
    "type": "CustomLocation"
  },
  "id": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123",
  "name": "lwucizfvtsdpx",
  "type": "Microsoft.IoTOperations/instances/brokers/authentications",
  "systemData": {
    "createdBy": "contosouser",
    "createdByType": "User",
    "createdAt": "2024-08-09T18:13:29.389Z",
    "lastModifiedBy": "contosouser",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-08-09T18:13:29.389Z"
  }
}

BrokerAuthentication_CreateOrUpdate_Complex

示例请求

PUT https://management.azure.com/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123?api-version=2025-10-01

{
  "properties": {
    "authenticationMethods": [
      {
        "method": "ServiceAccountToken",
        "serviceAccountTokenSettings": {
          "audiences": [
            "aio-internal"
          ]
        }
      },
      {
        "method": "X509",
        "x509Settings": {
          "trustedClientCaCert": "my-ca",
          "authorizationAttributes": {
            "root": {
              "subject": "CN = Contoso Root CA Cert, OU = Engineering, C = US",
              "attributes": {
                "organization": "contoso"
              }
            },
            "intermediate": {
              "subject": "CN = Contoso Intermediate CA",
              "attributes": {
                "city": "seattle",
                "foo": "bar"
              }
            },
            "smart-fan": {
              "subject": "CN = smart-fan",
              "attributes": {
                "building": "17"
              }
            }
          }
        }
      }
    ]
  },
  "extendedLocation": {
    "name": "/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.ExtendedLocation/customLocations/resource-123",
    "type": "CustomLocation"
  }
}

示例响应

{
  "properties": {
    "authenticationMethods": [
      {
        "method": "ServiceAccountToken",
        "serviceAccountTokenSettings": {
          "audiences": [
            "aio-internal"
          ]
        }
      },
      {
        "method": "X509",
        "x509Settings": {
          "trustedClientCaCert": "my-ca",
          "authorizationAttributes": {
            "root": {
              "subject": "CN = Contoso Root CA Cert, OU = Engineering, C = US",
              "attributes": {
                "organization": "contoso"
              }
            },
            "intermediate": {
              "subject": "CN = Contoso Intermediate CA",
              "attributes": {
                "city": "seattle",
                "foo": "bar"
              }
            },
            "smart-fan": {
              "subject": "CN = smart-fan",
              "attributes": {
                "building": "17"
              }
            }
          }
        }
      }
    ],
    "provisioningState": "Succeeded"
  },
  "extendedLocation": {
    "name": "/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.ExtendedLocation/customLocations/resource-123",
    "type": "CustomLocation"
  },
  "id": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123",
  "name": "lwucizfvtsdpx",
  "type": "Microsoft.IoTOperations/instances/brokers/authentications",
  "systemData": {
    "createdBy": "contosouser",
    "createdByType": "User",
    "createdAt": "2024-08-09T18:13:29.389Z",
    "lastModifiedBy": "contosouser",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-08-09T18:13:29.389Z"
  }
}
Azure-AsyncOperation: https://contoso.com/operationstatus
{
  "properties": {
    "authenticationMethods": [
      {
        "method": "ServiceAccountToken",
        "serviceAccountTokenSettings": {
          "audiences": [
            "aio-internal"
          ]
        }
      },
      {
        "method": "X509",
        "x509Settings": {
          "trustedClientCaCert": "my-ca",
          "authorizationAttributes": {
            "root": {
              "subject": "CN = Contoso Root CA Cert, OU = Engineering, C = US",
              "attributes": {
                "organization": "contoso"
              }
            },
            "intermediate": {
              "subject": "CN = Contoso Intermediate CA",
              "attributes": {
                "city": "seattle",
                "foo": "bar"
              }
            },
            "smart-fan": {
              "subject": "CN = smart-fan",
              "attributes": {
                "building": "17"
              }
            }
          }
        }
      }
    ],
    "provisioningState": "Succeeded"
  },
  "extendedLocation": {
    "name": "/subscriptions/F8C729F9-DF9C-4743-848F-96EE433D8E53/resourceGroups/rgiotoperations/providers/Microsoft.ExtendedLocation/customLocations/resource-123",
    "type": "CustomLocation"
  },
  "id": "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup123/providers/Microsoft.IoTOperations/instances/resource-name123/brokers/resource-name123/authentications/resource-name123",
  "name": "lwucizfvtsdpx",
  "type": "Microsoft.IoTOperations/instances/brokers/authentications",
  "systemData": {
    "createdBy": "contosouser",
    "createdByType": "User",
    "createdAt": "2024-08-09T18:13:29.389Z",
    "lastModifiedBy": "contosouser",
    "lastModifiedByType": "User",
    "lastModifiedAt": "2024-08-09T18:13:29.389Z"
  }
}

定义

名称 说明
BrokerAuthenticationMethod

代理身份验证模式

BrokerAuthenticationProperties

BrokerAuthentication 资源属性

BrokerAuthenticationResource

实例代理认证资源

BrokerAuthenticatorCustomAuth

自定义身份验证属性

BrokerAuthenticatorMethodCustom

BrokerAuthentication 的自定义方法

BrokerAuthenticatorMethods

代理身份验证策略集。 每个条目仅支持一种方法。

BrokerAuthenticatorMethodSat

BrokerAuthentication 的服务帐户令牌

BrokerAuthenticatorMethodX509

X509 用于 BrokerAuthentication。

BrokerAuthenticatorMethodX509Attributes

BrokerAuthenticatorMethodX509Attributes 属性。

BrokerAuthenticatorValidationMethods

X509 身份验证验证方法。

createdByType

创建资源的标识的类型。

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

ExtendedLocation

扩展位置是 Azure 位置的扩展。 它们提供了一种使用已启用 Azure ARC 的 Kubernetes 群集作为部署 Azure 服务实例的目标位置的方法。

ExtendedLocationType

接受的枚举定义 ExtendedLocation 类型。

ProvisioningState

枚举定义资源的状态。

ResourceHealthState

资源的运行状况。

systemData

与创建和上次修改资源相关的元数据。

X509ManualCertificate

X509 证书身份验证属性。

BrokerAuthenticationMethod

代理身份验证模式

说明
Custom

自定义身份验证配置。

ServiceAccountToken

ServiceAccountToken 身份验证配置。

X509

X.509 身份验证配置。

BrokerAuthenticationProperties

BrokerAuthentication 资源属性

名称 类型 默认值 说明
authenticationMethods

BrokerAuthenticatorMethods[]

定义一组要在 BrokerListeners中使用的代理身份验证方法。 对于每个数组元素,支持一个验证器类型。

healthState

ResourceHealthState

Unknown

资源的运行状况。

provisioningState

ProvisioningState

上次操作的状态。

BrokerAuthenticationResource

实例代理认证资源

名称 类型 说明
extendedLocation

ExtendedLocation

资源的边缘位置。

id

string (arm-id)

资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}”

name

string

资源的名称

properties

BrokerAuthenticationProperties

此资源的资源特定属性。

systemData

systemData

包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。

type

string

资源类型。 例如,“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

BrokerAuthenticatorCustomAuth

自定义身份验证属性

名称 类型 说明
x509

X509ManualCertificate

X509 自定义身份验证类型详细信息。

BrokerAuthenticatorMethodCustom

BrokerAuthentication 的自定义方法

名称 类型 说明
auth

BrokerAuthenticatorCustomAuth

使用自定义身份验证服务器进行身份验证所需的可选身份验证。

caCertConfigMap

string

用于验证自定义身份验证服务器的证书的可选 CA 证书。

endpoint

string (uri)

pattern: ^https://.*$

自定义身份验证服务器的终结点。 必须是 HTTPS 终结点。

headers

object

要传递给自定义身份验证服务器的其他 HTTP 标头。

BrokerAuthenticatorMethods

代理身份验证策略集。 每个条目仅支持一种方法。

名称 类型 说明
customSettings

BrokerAuthenticatorMethodCustom

自定义身份验证配置。

method

BrokerAuthenticationMethod

自定义身份验证配置。

serviceAccountTokenSettings

BrokerAuthenticatorMethodSat

ServiceAccountToken 身份验证配置。

x509Settings

BrokerAuthenticatorMethodX509

X.509 身份验证配置。

BrokerAuthenticatorMethodSat

BrokerAuthentication 的服务帐户令牌

名称 类型 说明
audiences

string[]

允许访问群体的列表。

BrokerAuthenticatorMethodX509

X509 用于 BrokerAuthentication。

名称 类型 默认值 说明
additionalValidation

BrokerAuthenticatorValidationMethods

X509 身份验证属性属性。

authorizationAttributes

<string,  BrokerAuthenticatorMethodX509Attributes>

X509 授权属性属性。

trustedClientCaCert

string

client-ca

受信任的客户端 ca 证书资源的名称。

BrokerAuthenticatorMethodX509Attributes

BrokerAuthenticatorMethodX509Attributes 属性。

名称 类型 说明
attributes

object

Attributes 对象。

subject

string

X509 属性的主题。

BrokerAuthenticatorValidationMethods

X509 身份验证验证方法。

说明
None

不执行其他验证

AzureDeviceRegistry

使用 Azure 设备注册表执行其他验证。

createdByType

创建资源的标识的类型。

说明
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

ExtendedLocation

扩展位置是 Azure 位置的扩展。 它们提供了一种使用已启用 Azure ARC 的 Kubernetes 群集作为部署 Azure 服务实例的目标位置的方法。

名称 类型 说明
name

string

扩展位置的名称。

type

ExtendedLocationType

ExtendedLocation 的类型。

ExtendedLocationType

接受的枚举定义 ExtendedLocation 类型。

说明
CustomLocation

CustomLocation 类型

ProvisioningState

枚举定义资源的状态。

说明
Succeeded

已创建资源。

Failed

资源创建失败。

Canceled

资源创建已取消。

Provisioning

资源正在预配。

Updating

资源正在更新。

Deleting

资源正在删除。

Accepted

资源已被接受。

ResourceHealthState

资源的运行状况。

说明
Available

资源可用且按预期运行。

Degraded

资源运行状况下降。

Unavailable

资源未按预期运行。

Unknown

资源状态未知。

systemData

与创建和上次修改资源相关的元数据。

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

上次修改的资源时间戳(UTC)

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

上次修改资源的标识的类型。

X509ManualCertificate

X509 证书身份验证属性。

名称 类型 说明
secretRef

string

包含 X.509 客户端证书的 Kubernetes 机密。 这是通过标识名称而不是机密本身对机密的引用。