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

Workspace Connections - Create

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}?api-version=2025-06-01

URI 参数

名称 必需 类型 说明
connectionName
path True

string

pattern: ^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$

工作区连接的友好名称

resourceGroupName
path True

string

minLength: 1
maxLength: 90

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

subscriptionId
path True

string

minLength: 1

目标订阅的 ID。

workspaceName
path True

string

pattern: ^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$

Azure 机器学习工作区的名称。

api-version
query True

string

minLength: 1

用于此操作的 API 版本。

请求正文

名称 必需 类型 说明
properties True WorkspaceConnectionPropertiesV2:

响应

名称 类型 说明
200 OK

WorkspaceConnectionPropertiesV2BasicResource

请求成功;请求格式正确,已正确接收。

Other Status Codes

ErrorResponse

错误

安全性

azure_auth

Azure Active Directory OAuth2 Flow。

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

作用域

名称 说明
user_impersonation 模拟用户帐户

示例

CreateWorkspaceConnection

示例请求

PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1/providers/Microsoft.MachineLearningServices/workspaces/workspace-1/connections/connection-1?api-version=2025-06-01

{
  "properties": {
    "category": "ContainerRegistry",
    "target": "www.facebook.com",
    "authType": "None"
  }
}

示例响应

{
  "id": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup-1/providers/Microsoft.MachineLearningServices/workspaces/workspace-1/connections/connection-1",
  "name": "connection-1",
  "type": "Microsoft.MachineLearningServices/workspaces/connections",
  "properties": {
    "category": "ContainerRegistry",
    "target": "www.facebook.com",
    "authType": "None"
  }
}

定义

名称 说明
AADAuthTypeWorkspaceConnectionProperties

此连接类型涵盖任何适用的 Azure 服务的 AAD 身份验证

AccessKeyAuthTypeWorkspaceConnectionProperties
AccountKeyAuthTypeWorkspaceConnectionProperties

此连接类型涵盖 Azure 存储的帐户密钥连接

ApiKeyAuthWorkspaceConnectionProperties

此连接类型涵盖泛型 ApiKey 身份验证连接类别,例如:AzureOpenAI:Category:= AzureOpenAI AuthType:= ApiKey (作为类型歧视性) 凭据:= {ApiKey} 作为 Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {ApiBase}

CognitiveService: Category:= CognitiveService AuthType:= ApiKey (作为类型鉴别器) 凭据:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= ServiceRegion={serviceRegion}

CognitiveSearch: Category:= CognitiveSearch AuthType:= ApiKey (作为类型鉴别器) 凭据:= {Key} 作为 Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {Endpoint}

对 ApiType、ApiVersion、Kind 和其他元数据字段使用元数据属性包

ConnectionAuthType

连接目标的身份验证类型

ConnectionCategory

连接的类别

ConnectionGroup

基于连接类别的组

createdByType

创建资源的标识的类型。

CustomKeys

自定义密钥凭据对象

CustomKeysWorkspaceConnectionProperties

Category:= CustomKeys AuthType:= CustomKeys (作为类型鉴别器)凭据:= {CustomKeys} 作为 Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys Target:= {any value} 使用 ApiVersion 和其他元数据字段的元数据属性包

ErrorAdditionalInfo

资源管理错误附加信息。

ErrorDetail

错误详细信息。

ErrorResponse

错误响应

ManagedIdentityAuthTypeWorkspaceConnectionProperties
NoneAuthTypeWorkspaceConnectionProperties
OAuth2AuthTypeWorkspaceConnectionProperties
PATAuthTypeWorkspaceConnectionProperties
SASAuthTypeWorkspaceConnectionProperties
ServicePrincipalAuthTypeWorkspaceConnectionProperties
systemData

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

UsernamePasswordAuthTypeWorkspaceConnectionProperties
ValueFormat

工作区连接值的格式

WorkspaceConnectionAccessKey
WorkspaceConnectionAccountKey
WorkspaceConnectionApiKey

工作区连接凭据的 API 密钥对象。

WorkspaceConnectionManagedIdentity
WorkspaceConnectionOAuth2

需要 ClientId 和 ClientSecret。 其他属性是可选的,具体取决于每个 OAuth2 提供程序的实现。

WorkspaceConnectionPersonalAccessToken
WorkspaceConnectionPropertiesV2BasicResource
WorkspaceConnectionServicePrincipal
WorkspaceConnectionSharedAccessSignature
WorkspaceConnectionUsernamePassword

AADAuthTypeWorkspaceConnectionProperties

此连接类型涵盖任何适用的 Azure 服务的 AAD 身份验证

名称 类型 说明
authType string:

AAD

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

AccessKeyAuthTypeWorkspaceConnectionProperties

名称 类型 说明
authType string:

AccessKey

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

credentials

WorkspaceConnectionAccessKey

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

AccountKeyAuthTypeWorkspaceConnectionProperties

此连接类型涵盖 Azure 存储的帐户密钥连接

名称 类型 说明
authType string:

AccountKey

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

credentials

WorkspaceConnectionAccountKey

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

ApiKeyAuthWorkspaceConnectionProperties

此连接类型涵盖泛型 ApiKey 身份验证连接类别,例如:AzureOpenAI:Category:= AzureOpenAI AuthType:= ApiKey (作为类型歧视性) 凭据:= {ApiKey} 作为 Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {ApiBase}

CognitiveService: Category:= CognitiveService AuthType:= ApiKey (作为类型鉴别器) 凭据:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= ServiceRegion={serviceRegion}

CognitiveSearch: Category:= CognitiveSearch AuthType:= ApiKey (作为类型鉴别器) 凭据:= {Key} 作为 Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {Endpoint}

对 ApiType、ApiVersion、Kind 和其他元数据字段使用元数据属性包

名称 类型 说明
authType string:

ApiKey

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

credentials

WorkspaceConnectionApiKey

工作区连接凭据的 API 密钥对象。

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

ConnectionAuthType

连接目标的身份验证类型

说明
AAD
AccessKey
AccountKey
ApiKey
CustomKeys
ManagedIdentity
None
OAuth2
PAT
SAS
ServicePrincipal
UsernamePassword

ConnectionCategory

连接的类别

说明
ADLSGen2
AIServices
AmazonMws
AmazonRdsForOracle
AmazonRdsForSqlServer
AmazonRedshift
AmazonS3Compatible
ApiKey
AzureBlob
AzureDataExplorer
AzureDatabricksDeltaLake
AzureMariaDb
AzureMySqlDb
AzureOneLake
AzureOpenAI
AzurePostgresDb
AzureSqlDb
AzureSqlMi
AzureSynapseAnalytics
AzureTableStorage
BingLLMSearch
Cassandra
CognitiveSearch
CognitiveService
Concur
ContainerRegistry
CosmosDb
CosmosDbMongoDbApi
Couchbase
CustomKeys
Db2
Drill
Dynamics
DynamicsAx
DynamicsCrm
Elasticsearch
Eloqua
FileServer
FtpServer
GenericContainerRegistry
GenericHttp
GenericRest
Git
GoogleAdWords
GoogleBigQuery
GoogleCloudStorage
Greenplum
Hbase
Hdfs
Hive
Hubspot
Impala
Informix
Jira
Magento
ManagedOnlineEndpoint
MariaDb
Marketo
MicrosoftAccess
MongoDbAtlas
MongoDbV2
MySql
Netezza
ODataRest
Odbc
Office365
OpenAI
Oracle
OracleCloudStorage
OracleServiceCloud
PayPal
Phoenix
Pinecone
PostgreSql
Presto
PythonFeed
QuickBooks
Redis
Responsys
S3
Salesforce
SalesforceMarketingCloud
SalesforceServiceCloud
SapBw
SapCloudForCustomer
SapEcc
SapHana
SapOpenHub
SapTable
Serp
Serverless
ServiceNow
Sftp
SharePointOnlineList
Shopify
Snowflake
Spark
SqlServer
Square
Sybase
Teradata
Vertica
WebTable
Xero
Zoho

ConnectionGroup

基于连接类别的组

说明
Azure
AzureAI
Database
File
GenericProtocol
NoSQL
ServicesAndApps

createdByType

创建资源的标识的类型。

说明
Application
Key
ManagedIdentity
User

CustomKeys

自定义密钥凭据对象

名称 类型 说明
keys

object

CustomKeysWorkspaceConnectionProperties

Category:= CustomKeys AuthType:= CustomKeys (作为类型鉴别器)凭据:= {CustomKeys} 作为 Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys Target:= {any value} 使用 ApiVersion 和其他元数据字段的元数据属性包

名称 类型 说明
authType string:

CustomKeys

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

credentials

CustomKeys

自定义密钥凭据对象

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

ErrorAdditionalInfo

资源管理错误附加信息。

名称 类型 说明
info

object

其他信息。

type

string

其他信息类型。

ErrorDetail

错误详细信息。

名称 类型 说明
additionalInfo

ErrorAdditionalInfo[]

错误附加信息。

code

string

错误代码。

details

ErrorDetail[]

错误详细信息。

message

string

错误消息。

target

string

错误目标。

ErrorResponse

错误响应

名称 类型 说明
error

ErrorDetail

错误对象。

ManagedIdentityAuthTypeWorkspaceConnectionProperties

名称 类型 说明
authType string:

ManagedIdentity

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

credentials

WorkspaceConnectionManagedIdentity

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

NoneAuthTypeWorkspaceConnectionProperties

名称 类型 说明
authType string:

None

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

OAuth2AuthTypeWorkspaceConnectionProperties

名称 类型 说明
authType string:

OAuth2

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

credentials

WorkspaceConnectionOAuth2

需要 ClientId 和 ClientSecret。 其他属性是可选的,具体取决于每个 OAuth2 提供程序的实现。

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

PATAuthTypeWorkspaceConnectionProperties

名称 类型 说明
authType string:

PAT

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

credentials

WorkspaceConnectionPersonalAccessToken

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

SASAuthTypeWorkspaceConnectionProperties

名称 类型 说明
authType string:

SAS

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

credentials

WorkspaceConnectionSharedAccessSignature

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

ServicePrincipalAuthTypeWorkspaceConnectionProperties

名称 类型 说明
authType string:

ServicePrincipal

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

credentials

WorkspaceConnectionServicePrincipal

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

systemData

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

名称 类型 说明
createdAt

string (date-time)

资源创建时间戳(UTC)。

createdBy

string

创建资源的标识。

createdByType

createdByType

创建资源的标识的类型。

lastModifiedAt

string (date-time)

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

lastModifiedBy

string

上次修改资源的标识。

lastModifiedByType

createdByType

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

UsernamePasswordAuthTypeWorkspaceConnectionProperties

名称 类型 说明
authType string:

UsernamePassword

连接目标的身份验证类型

category

ConnectionCategory

连接的类别

createdByWorkspaceArmId

string (arm-id)

credentials

WorkspaceConnectionUsernamePassword

expiryTime

string (date-time)

group

ConnectionGroup

基于连接类别的组

isSharedToAll

boolean

metadata

object

存储此连接的用户元数据

sharedUserList

string[]

target

string

value

string

工作区连接的值详细信息。

valueFormat

ValueFormat

工作区连接值的格式

ValueFormat

工作区连接值的格式

说明
JSON

WorkspaceConnectionAccessKey

名称 类型 说明
accessKeyId

string

secretAccessKey

string

WorkspaceConnectionAccountKey

名称 类型 说明
key

string

WorkspaceConnectionApiKey

工作区连接凭据的 API 密钥对象。

名称 类型 说明
key

string

WorkspaceConnectionManagedIdentity

名称 类型 说明
clientId

string

resourceId

string

WorkspaceConnectionOAuth2

需要 ClientId 和 ClientSecret。 其他属性是可选的,具体取决于每个 OAuth2 提供程序的实现。

名称 类型 说明
authUrl

string (url)

Concur 连接类别必需

clientId

string (uuid)

UUID 格式的客户端 ID

clientSecret

string

developerToken

string

GoogleAdWords 连接类别要求

password

string

refreshToken

string

GoogleBigQuery、GoogleAdWords、Hubspot、QuickBooks、Square、Xero、Zoho 需要让用户脱机获取 RefreshToken

tenantId

string

QuickBooks 和 Xero 连接类别必需

username

string

Concur,ServiceNow 身份验证服务器 AccessToken 授权类型为“Password”,需要 UsernamePassword

WorkspaceConnectionPersonalAccessToken

名称 类型 说明
pat

string

WorkspaceConnectionPropertiesV2BasicResource

名称 类型 说明
id

string

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

name

string

资源的名称

properties WorkspaceConnectionPropertiesV2:
systemData

systemData

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

type

string

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

WorkspaceConnectionServicePrincipal

名称 类型 说明
clientId

string

clientSecret

string

tenantId

string

WorkspaceConnectionSharedAccessSignature

名称 类型 说明
sas

string

WorkspaceConnectionUsernamePassword

名称 类型 说明
password

string

securityToken

string

可选,除了 UsernamePassword 之外,SalesForce 等连接还需要额外的安全性

username

string