Skip to main content

datasets

Creates, updates, deletes, gets or lists a datasets resource.

Overview

Namedatasets
TypeResource
Idazure.ai_projects.datasets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringAsset ID, a unique identifier for the asset.
namestringThe name of the resource. Required.
connectionNamestringThe Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset.
dataUristringURI of the data (example _). Required.
descriptionstringThe asset description text.
isReferencebooleanIndicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted.
tagsobjectTag dictionary. Tags can be added, removed, and updated.
typestringDataset type. Required. Known values are: "uri_file" and "uri_folder".
versionstringThe version of the resource. Required.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectname, version, endpointGet a version. Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist.
list_versionsselectname, endpointList versions. List all versions of the given DatasetVersion.
listselectendpointList latest versions. List the latest version of each DatasetVersion.
create_or_updateinsertname, version, endpoint, dataUri, typeCreate or update a version. Create a new or update an existing DatasetVersion with the given version id.
create_or_updatereplacename, version, endpoint, dataUri, typeCreate or update a version. Create a new or update an existing DatasetVersion with the given version id.
deletedeletename, version, endpointDelete a version. Delete the specific version of the DatasetVersion. The service returns 204 No Content if the DatasetVersion was deleted successfully or if the DatasetVersion does not exist.
get_credentialsexecname, version, endpointGet dataset credentials. Gets the SAS credential to access the storage account associated with a Dataset version.
pending_uploadexecname, version, endpoint, pendingUploadTypeStart a pending upload. Initiates a new pending upload or retrieves an existing one for the specified dataset version.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: )
namestringThe name of the resource. Required.
versionstringThe specific version id of the DatasetVersion to operate on. Required.

SELECT examples

Get a version. Get the specific version of the DatasetVersion. The service returns 404 Not Found error if the DatasetVersion does not exist.

SELECT
id,
name,
connectionName,
dataUri,
description,
isReference,
tags,
type,
version
FROM azure.ai_projects.datasets
WHERE name = '{{ name }}' -- required
AND version = '{{ version }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;

INSERT examples

Create or update a version. Create a new or update an existing DatasetVersion with the given version id.

INSERT INTO azure.ai_projects.datasets (
dataUri,
type,
connectionName,
description,
tags,
name,
version,
endpoint
)
SELECT
'{{ dataUri }}' /* required */,
'{{ type }}' /* required */,
'{{ connectionName }}',
'{{ description }}',
'{{ tags }}',
'{{ name }}',
'{{ version }}',
'{{ endpoint }}'
RETURNING
id,
name,
connectionName,
dataUri,
description,
isReference,
tags,
type,
version
;

REPLACE examples

Create or update a version. Create a new or update an existing DatasetVersion with the given version id.

REPLACE azure.ai_projects.datasets
SET
dataUri = '{{ dataUri }}',
type = '{{ type }}',
connectionName = '{{ connectionName }}',
description = '{{ description }}',
tags = '{{ tags }}'
WHERE
name = '{{ name }}' --required
AND version = '{{ version }}' --required
AND endpoint = '{{ endpoint }}' --required
AND dataUri = '{{ dataUri }}' --required
AND type = '{{ type }}' --required
RETURNING
id,
name,
connectionName,
dataUri,
description,
isReference,
tags,
type,
version;

DELETE examples

Delete a version. Delete the specific version of the DatasetVersion. The service returns 204 No Content if the DatasetVersion was deleted successfully or if the DatasetVersion does not exist.

DELETE FROM azure.ai_projects.datasets
WHERE name = '{{ name }}' --required
AND version = '{{ version }}' --required
AND endpoint = '{{ endpoint }}' --required
;

Lifecycle Methods

Get dataset credentials. Gets the SAS credential to access the storage account associated with a Dataset version.

EXEC azure.ai_projects.datasets.get_credentials 
@name='{{ name }}' --required,
@version='{{ version }}' --required,
@endpoint='{{ endpoint }}' --required
;