Workspace Connections - Create

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

URI Parameters

Name In Required Type Description
connectionName
path True

string

Friendly name of the workspace connection

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

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

The ID of the target subscription.

workspaceName
path True

string

Name of Azure Machine Learning workspace.

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

api-version
query True

string

The API version to use for this operation.

Request Body

Name Required Type Description
properties True WorkspaceConnectionPropertiesV2:

Responses

Name Type Description
200 OK

WorkspaceConnectionPropertiesV2BasicResource

The request was successful; the request was well-formed and received properly.

Other Status Codes

ErrorResponse

Error

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

CreateWorkspaceConnection

Sample request

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=2024-10-01

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

Sample response

{
  "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"
  }
}

Definitions

Name Description
AADAuthTypeWorkspaceConnectionProperties

This connection type covers the AAD auth for any applicable Azure service

AccessKeyAuthTypeWorkspaceConnectionProperties
AccountKeyAuthTypeWorkspaceConnectionProperties

This connection type covers the account key connection for Azure storage

ApiKeyAuthWorkspaceConnectionProperties

This connection type covers the generic ApiKey auth connection categories, for examples: AzureOpenAI: Category:= AzureOpenAI AuthType:= ApiKey (as type discriminator) Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {ApiBase}

CognitiveService: Category:= CognitiveService AuthType:= ApiKey (as type discriminator) Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= ServiceRegion={serviceRegion}

CognitiveSearch: Category:= CognitiveSearch AuthType:= ApiKey (as type discriminator) Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {Endpoint}

Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields

ConnectionAuthType

Authentication type of the connection target

ConnectionCategory

Category of the connection

ConnectionGroup

Group based on connection category

createdByType

The type of identity that created the resource.

CustomKeys

Custom Keys credential object

CustomKeysWorkspaceConnectionProperties

Category:= CustomKeys AuthType:= CustomKeys (as type discriminator) Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys Target:= {any value} Use Metadata property bag for ApiVersion and other metadata fields

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ManagedIdentityAuthTypeWorkspaceConnectionProperties
NoneAuthTypeWorkspaceConnectionProperties
OAuth2AuthTypeWorkspaceConnectionProperties
PATAuthTypeWorkspaceConnectionProperties
SASAuthTypeWorkspaceConnectionProperties
ServicePrincipalAuthTypeWorkspaceConnectionProperties
systemData

Metadata pertaining to creation and last modification of the resource.

UsernamePasswordAuthTypeWorkspaceConnectionProperties
ValueFormat

format for the workspace connection value

WorkspaceConnectionAccessKey
WorkspaceConnectionAccountKey
WorkspaceConnectionApiKey

Api key object for workspace connection credential.

WorkspaceConnectionManagedIdentity
WorkspaceConnectionOAuth2

ClientId and ClientSecret are required. Other properties are optional depending on each OAuth2 provider's implementation.

WorkspaceConnectionPersonalAccessToken
WorkspaceConnectionPropertiesV2BasicResource
WorkspaceConnectionServicePrincipal
WorkspaceConnectionSharedAccessSignature
WorkspaceConnectionUsernamePassword

AADAuthTypeWorkspaceConnectionProperties

This connection type covers the AAD auth for any applicable Azure service

Name Type Description
authType string:

AAD

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

AccessKeyAuthTypeWorkspaceConnectionProperties

Name Type Description
authType string:

AccessKey

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

credentials

WorkspaceConnectionAccessKey

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

AccountKeyAuthTypeWorkspaceConnectionProperties

This connection type covers the account key connection for Azure storage

Name Type Description
authType string:

AccountKey

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

credentials

WorkspaceConnectionAccountKey

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

ApiKeyAuthWorkspaceConnectionProperties

This connection type covers the generic ApiKey auth connection categories, for examples: AzureOpenAI: Category:= AzureOpenAI AuthType:= ApiKey (as type discriminator) Credentials:= {ApiKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {ApiBase}

CognitiveService: Category:= CognitiveService AuthType:= ApiKey (as type discriminator) Credentials:= {SubscriptionKey} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= ServiceRegion={serviceRegion}

CognitiveSearch: Category:= CognitiveSearch AuthType:= ApiKey (as type discriminator) Credentials:= {Key} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.ApiKey Target:= {Endpoint}

Use Metadata property bag for ApiType, ApiVersion, Kind and other metadata fields

Name Type Description
authType string:

ApiKey

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

credentials

WorkspaceConnectionApiKey

Api key object for workspace connection credential.

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

ConnectionAuthType

Authentication type of the connection target

Value Description
AAD
AccessKey
AccountKey
ApiKey
CustomKeys
ManagedIdentity
None
OAuth2
PAT
SAS
ServicePrincipal
UsernamePassword

ConnectionCategory

Category of the connection

Value Description
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

Group based on connection category

Value Description
Azure
AzureAI
Database
File
GenericProtocol
NoSQL
ServicesAndApps

createdByType

The type of identity that created the resource.

Value Description
Application
Key
ManagedIdentity
User

CustomKeys

Custom Keys credential object

Name Type Description
keys

object

CustomKeysWorkspaceConnectionProperties

Category:= CustomKeys AuthType:= CustomKeys (as type discriminator) Credentials:= {CustomKeys} as Microsoft.MachineLearning.AccountRP.Contracts.WorkspaceConnection.CustomKeys Target:= {any value} Use Metadata property bag for ApiVersion and other metadata fields

Name Type Description
authType string:

CustomKeys

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

credentials

CustomKeys

Custom Keys credential object

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ManagedIdentityAuthTypeWorkspaceConnectionProperties

Name Type Description
authType string:

ManagedIdentity

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

credentials

WorkspaceConnectionManagedIdentity

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

NoneAuthTypeWorkspaceConnectionProperties

Name Type Description
authType string:

None

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

OAuth2AuthTypeWorkspaceConnectionProperties

Name Type Description
authType string:

OAuth2

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

credentials

WorkspaceConnectionOAuth2

ClientId and ClientSecret are required. Other properties are optional depending on each OAuth2 provider's implementation.

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

PATAuthTypeWorkspaceConnectionProperties

Name Type Description
authType string:

PAT

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

credentials

WorkspaceConnectionPersonalAccessToken

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

SASAuthTypeWorkspaceConnectionProperties

Name Type Description
authType string:

SAS

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

credentials

WorkspaceConnectionSharedAccessSignature

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

ServicePrincipalAuthTypeWorkspaceConnectionProperties

Name Type Description
authType string:

ServicePrincipal

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

credentials

WorkspaceConnectionServicePrincipal

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

UsernamePasswordAuthTypeWorkspaceConnectionProperties

Name Type Description
authType string:

UsernamePassword

Authentication type of the connection target

category

ConnectionCategory

Category of the connection

createdByWorkspaceArmId

string

credentials

WorkspaceConnectionUsernamePassword

expiryTime

string

group

ConnectionGroup

Group based on connection category

isSharedToAll

boolean

metadata

object

Store user metadata for this connection

sharedUserList

string[]

target

string

value

string

Value details of the workspace connection.

valueFormat

ValueFormat

format for the workspace connection value

ValueFormat

format for the workspace connection value

Value Description
JSON

WorkspaceConnectionAccessKey

Name Type Description
accessKeyId

string

secretAccessKey

string

WorkspaceConnectionAccountKey

Name Type Description
key

string

WorkspaceConnectionApiKey

Api key object for workspace connection credential.

Name Type Description
key

string

WorkspaceConnectionManagedIdentity

Name Type Description
clientId

string

resourceId

string

WorkspaceConnectionOAuth2

ClientId and ClientSecret are required. Other properties are optional depending on each OAuth2 provider's implementation.

Name Type Description
authUrl

string

Required by Concur connection category

clientId

string

Client id in the format of UUID

clientSecret

string

developerToken

string

Required by GoogleAdWords connection category

password

string

refreshToken

string

Required by GoogleBigQuery, GoogleAdWords, Hubspot, QuickBooks, Square, Xero, Zoho where user needs to get RefreshToken offline

tenantId

string

Required by QuickBooks and Xero connection categories

username

string

Concur, ServiceNow auth server AccessToken grant type is 'Password' which requires UsernamePassword

WorkspaceConnectionPersonalAccessToken

Name Type Description
pat

string

WorkspaceConnectionPropertiesV2BasicResource

Name Type Description
id

string

Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

The name of the resource

properties WorkspaceConnectionPropertiesV2:
systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

WorkspaceConnectionServicePrincipal

Name Type Description
clientId

string

clientSecret

string

tenantId

string

WorkspaceConnectionSharedAccessSignature

Name Type Description
sas

string

WorkspaceConnectionUsernamePassword

Name Type Description
password

string

securityToken

string

Optional, required by connections like SalesForce for extra security in addition to UsernamePassword

username

string