Workspace Connections - Create
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/connections/{connectionName}?api-version=2025-09-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
connection
|
path | True |
string pattern: ^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$ |
工作区连接的友好名称 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
workspace
|
path | True |
string pattern: ^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$ |
Azure 机器学习工作区的名称。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
请求正文
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
请求成功;该请求格式合理,并得到妥善处理。 |
|
| Other Status Codes |
错误 |
安全性
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-09-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"
}
}
定义
| 名称 | 说明 |
|---|---|
|
AADAuth |
此连接类型涵盖任何适用的 Azure 服务的 AAD 身份验证 |
|
Access |
|
|
Account |
此连接类型涵盖 Azure 存储的帐户密钥连接 |
|
Api |
此连接类型涵盖通用 ApiKey 身份验证连接类别,例如: AzureOpenAI: Category:= AzureOpenAI AuthType:= ApiKey(作为类型鉴别器) Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {ApiBase} CognitiveService: Category:= CognitiveService AuthType:= ApiKey (作为类型鉴别器) Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= ServiceRegion={serviceRegion} CognitiveSearch: Category:= CognitiveSearch AuthType:= ApiKey (作为类型鉴别器) Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {Endpoint} 将元数据属性包用于 ApiType、ApiVersion、Kind 和其他元数据字段 |
|
Connection |
连接目标的身份验证类型 |
|
Connection |
连接的类别 |
|
Connection |
根据连接类别分组 |
|
created |
创建资源的标识的类型。 |
|
Custom |
自定义密钥凭据对象 |
|
Custom |
Category:= CustomKeys AuthType:= CustomKeys(作为类型鉴别器) Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys Target:= {any value} 将元数据属性包用于 ApiVersion 和其他元数据字段 |
|
Error |
资源管理错误附加信息。 |
|
Error |
错误详细信息。 |
|
Error |
错误响应 |
|
Managed |
|
|
None |
|
|
OAuth2Auth |
|
|
PATAuth |
|
|
SASAuth |
|
|
Service |
|
|
system |
与创建和上次修改资源相关的元数据。 |
|
Username |
|
|
Value |
工作区连接值的格式 |
|
Workspace |
|
|
Workspace |
|
|
Workspace |
工作区连接凭据的 API 密钥对象。 |
|
Workspace |
|
|
Workspace |
需要 ClientId 和 ClientSecret。 其他属性是可选的,具体取决于每个 OAuth2 提供程序的实现。 |
|
Workspace |
|
|
Workspace |
|
|
Workspace |
|
|
Workspace |
|
|
Workspace |
AADAuthTypeWorkspaceConnectionProperties
此连接类型涵盖任何适用的 Azure 服务的 AAD 身份验证
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
AAD |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
AccessKeyAuthTypeWorkspaceConnectionProperties
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
Access |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| credentials | ||
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
AccountKeyAuthTypeWorkspaceConnectionProperties
此连接类型涵盖 Azure 存储的帐户密钥连接
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
Account |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| credentials | ||
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
ApiKeyAuthWorkspaceConnectionProperties
此连接类型涵盖通用 ApiKey 身份验证连接类别,例如: AzureOpenAI: Category:= AzureOpenAI AuthType:= ApiKey(作为类型鉴别器) Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {ApiBase}
CognitiveService: Category:= CognitiveService AuthType:= ApiKey (作为类型鉴别器) Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= ServiceRegion={serviceRegion}
CognitiveSearch: Category:= CognitiveSearch AuthType:= ApiKey (作为类型鉴别器) Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {Endpoint}
将元数据属性包用于 ApiType、ApiVersion、Kind 和其他元数据字段
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
Api |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| credentials |
工作区连接凭据的 API 密钥对象。 |
|
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
ConnectionAuthType
连接目标的身份验证类型
| 值 | 说明 |
|---|---|
| PAT | |
| ManagedIdentity | |
| UsernamePassword | |
| None | |
| SAS | |
| AccountKey | |
| ServicePrincipal | |
| AccessKey | |
| ApiKey | |
| CustomKeys | |
| OAuth2 | |
| AAD |
ConnectionCategory
连接的类别
| 值 | 说明 |
|---|---|
| PythonFeed | |
| ContainerRegistry | |
| Git | |
| S3 | |
| Snowflake | |
| AzureSqlDb | |
| AzureSynapseAnalytics | |
| AzureMySqlDb | |
| AzurePostgresDb | |
| ADLSGen2 | |
| Redis | |
| ApiKey | |
| AzureOpenAI | |
| AIServices | |
| CognitiveSearch | |
| CognitiveService | |
| CustomKeys | |
| AzureBlob | |
| AzureOneLake | |
| CosmosDb | |
| CosmosDbMongoDbApi | |
| AzureDataExplorer | |
| AzureMariaDb | |
| AzureDatabricksDeltaLake | |
| AzureSqlMi | |
| AzureTableStorage | |
| AmazonRdsForOracle | |
| AmazonRdsForSqlServer | |
| AmazonRedshift | |
| Db2 | |
| Drill | |
| GoogleBigQuery | |
| Greenplum | |
| Hbase | |
| Hive | |
| Impala | |
| Informix | |
| MariaDb | |
| MicrosoftAccess | |
| MySql | |
| Netezza | |
| Oracle | |
| Phoenix | |
| PostgreSql | |
| Presto | |
| SapOpenHub | |
| SapBw | |
| SapHana | |
| SapTable | |
| Spark | |
| SqlServer | |
| Sybase | |
| Teradata | |
| Vertica | |
| Pinecone | |
| Cassandra | |
| Couchbase | |
| MongoDbV2 | |
| MongoDbAtlas | |
| AmazonS3Compatible | |
| FileServer | |
| FtpServer | |
| GoogleCloudStorage | |
| Hdfs | |
| OracleCloudStorage | |
| Sftp | |
| GenericHttp | |
| ODataRest | |
| Odbc | |
| GenericRest | |
| AmazonMws | |
| Concur | |
| Dynamics | |
| DynamicsAx | |
| DynamicsCrm | |
| GoogleAdWords | |
| Hubspot | |
| Jira | |
| Magento | |
| Marketo | |
| Office365 | |
| Eloqua | |
| Responsys | |
| OracleServiceCloud | |
| PayPal | |
| QuickBooks | |
| Salesforce | |
| SalesforceServiceCloud | |
| SalesforceMarketingCloud | |
| SapCloudForCustomer | |
| SapEcc | |
| ServiceNow | |
| SharePointOnlineList | |
| Shopify | |
| Square | |
| WebTable | |
| Xero | |
| Zoho | |
| GenericContainerRegistry | |
| Elasticsearch | |
| OpenAI | |
| Serp | |
| BingLLMSearch | |
| Serverless | |
| ManagedOnlineEndpoint |
ConnectionGroup
根据连接类别分组
| 值 | 说明 |
|---|---|
| Azure | |
| AzureAI | |
| Database | |
| NoSQL | |
| File | |
| GenericProtocol | |
| ServicesAndApps |
createdByType
创建资源的标识的类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
CustomKeys
自定义密钥凭据对象
| 名称 | 类型 | 说明 |
|---|---|---|
| keys |
object |
CustomKeysWorkspaceConnectionProperties
Category:= CustomKeys AuthType:= CustomKeys(作为类型鉴别器) Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys Target:= {any value} 将元数据属性包用于 ApiVersion 和其他元数据字段
| 名称 | 类型 | 说明 |
|---|---|---|
| authType | string: |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| credentials |
自定义密钥凭据对象 |
|
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
ErrorAdditionalInfo
资源管理错误附加信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| info |
object |
其他信息。 |
| type |
string |
其他信息类型。 |
ErrorDetail
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| additionalInfo |
错误附加信息。 |
|
| code |
string |
错误代码。 |
| details |
错误详细信息。 |
|
| message |
string |
错误消息。 |
| target |
string |
错误目标。 |
ErrorResponse
错误响应
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
ManagedIdentityAuthTypeWorkspaceConnectionProperties
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
Managed |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| credentials | ||
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
NoneAuthTypeWorkspaceConnectionProperties
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
None |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
OAuth2AuthTypeWorkspaceConnectionProperties
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
OAuth2 |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| credentials |
需要 ClientId 和 ClientSecret。 其他属性是可选的,具体取决于每个 OAuth2 提供程序的实现。 |
|
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
PATAuthTypeWorkspaceConnectionProperties
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
PAT |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| credentials | ||
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
SASAuthTypeWorkspaceConnectionProperties
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
SAS |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| credentials | ||
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
ServicePrincipalAuthTypeWorkspaceConnectionProperties
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
Service |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| credentials | ||
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| valueFormat |
工作区连接值的格式 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建资源的标识。 |
| createdByType |
创建资源的标识的类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |
UsernamePasswordAuthTypeWorkspaceConnectionProperties
| 名称 | 类型 | 说明 |
|---|---|---|
| authType |
string:
Username |
连接目标的身份验证类型 |
| category |
连接的类别 |
|
| createdByWorkspaceArmId |
string (arm-id) |
|
| credentials | ||
| expiryTime |
string (date-time) |
|
| group |
根据连接类别分组 |
|
| isSharedToAll |
boolean |
|
| metadata |
object |
存储此连接的用户元数据 |
| sharedUserList |
string[] |
|
| target |
string |
|
| value |
string |
工作区连接的值详细信息。 |
| 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 授权类型为“密码”,需要 UsernamePassword |
WorkspaceConnectionPersonalAccessToken
| 名称 | 类型 | 说明 |
|---|---|---|
| pat |
string |
WorkspaceConnectionPropertiesV2BasicResource
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源的完全限定资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} |
| name |
string |
资源的名称 |
| properties |
WorkspaceConnectionPropertiesV2:
|
|
| 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 |