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 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
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-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"
}
}
定义
名称 | 说明 |
---|---|
AADAuth |
此连接类型涵盖任何适用的 Azure 服务的 AAD 身份验证 |
Access |
|
Account |
此连接类型涵盖 Azure 存储的帐户密钥连接 |
Api |
此连接类型涵盖泛型 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 和其他元数据字段使用元数据属性包 |
Connection |
连接目标的身份验证类型 |
Connection |
连接的类别 |
Connection |
基于连接类别的组 |
created |
创建资源的标识的类型。 |
Custom |
自定义密钥凭据对象 |
Custom |
Category:= CustomKeys AuthType:= CustomKeys (作为类型鉴别器)凭据:= {CustomKeys} 作为 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 (作为类型歧视性) 凭据:= {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:
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
连接目标的身份验证类型
值 | 说明 |
---|---|
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: |
连接目标的身份验证类型 |
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 授权类型为“Password”,需要 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 |