APIKeyConnection Class

Note

This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.

A generic connection for any API key-based service.

Inheritance
azure.ai.ml.entities._workspace.connections.connection_subtypes.ApiOrAadConnection
APIKeyConnection

Constructor

APIKeyConnection(*, api_base: str, api_key: str | None = None, **kwargs)

Parameters

Name Description
name
Required
str

Name of the connection.

api_base
Required
str

The URL to target with this connection.

api_key
Required

The API key needed to connect to the api_base.

tags
Required

Tag dictionary. Tags can be added, removed, and updated.

Methods

dump

Dump the connection spec into a file in yaml format.

dump

Dump the connection spec into a file in yaml format.

dump(dest: str | PathLike | IO, **kwargs: Any) -> None

Parameters

Name Description
dest
Required
Union[<xref:PathLike>, str, IO[AnyStr]]

The destination to receive this connection's spec. Must be either a path to a local file, or an already-open file stream. If dest is a file path, a new file will be created, and an exception is raised if the file exists. If dest is an open file, the file will be written to directly, and an exception will be raised if the file is not writable.

Attributes

api_base

Alternate name for the target of the connection, which is used by some connection subclasses.

Returns

Type Description
str

The target of the connection.

api_key

The API key of the connection.

Returns

Type Description

The API key of the connection.

azure_endpoint

Alternate name for the target of the connection, which is used by some connection subclasses.

Returns

Type Description
str

The target of the connection.

base_path

The base path of the resource.

Returns

Type Description
str

The base path of the resource.

creation_context

The creation context of the resource.

Returns

Type Description

The creation metadata for the resource.

credentials

endpoint

Alternate name for the target of the connection, which is used by some connection subclasses.

Returns

Type Description
str

The target of the connection.

id

The resource ID.

Returns

Type Description

The global ID of the resource, an Azure Resource Manager (ARM) ID.

is_shared

Get the Boolean describing if this connection is shared amongst its cohort within a hub. Only applicable for connections created within a project.

Returns

Type Description

metadata

Deprecated. Use tags. :return: This connection's tags. :rtype: Dict[str, Any]

target

Target url for the connection.

Returns

Type Description

Target of the connection.

type

Type of the connection, supported are 'git', 'python_feed' and 'container_registry'.

Returns

Type Description
str

Type of the job.

url

Alternate name for the target of the connection, which is used by some connection subclasses.

Returns

Type Description
str

The target of the connection.