CLI (v2) 数据 YAML 架构

适用于:Azure CLI ml 扩展 v2(当前版本)

源 JSON 架构可在 https://azuremlschemas.azureedge.net/latest/data.schema.json 中找到。

注意

本文档中详细介绍的 YAML 语法基于最新版本的 ML CLI v2 扩展的 JSON 架构。 此语法必定仅适用于最新版本的 ML CLI v2 扩展。 可以在 https://azuremlschemasprod.azureedge.net/ 上查找早期扩展版本的架构。

YAML 语法

密钥 类型 说明 允许的值 默认值
$schema 字符串 YAML 架构。 如果使用 Azure 机器学习 Visual Studio Code 扩展创作 YAML 文件,则可以通过在文件顶部包含 $schema 来调用架构和资源完成。
name 字符串 必需。 数据资产名称。
version 字符串 数据集版本。 如果省略,Azure 机器学习将自动生成一个版本。
description 字符串 数据资产说明。
tags object 数据存储标记字典。
type 字符串 数据资产类型。 为指向单个文件源的数据指定 uri_file,或为指向文件夹源的数据指定 uri_folder uri_fileuri_folder uri_folder
path string 数据源文件或文件夹的本地路径,或数据源文件或文件夹的云路径的 URI。 确保此处提供的源与指定的 type 兼容。

支持的 URI 类型为 azuremlhttpswasbsabfssadl。 要详细了解如何使用 azureml:// URI 格式,请参阅核心 YAML 语法

备注

az ml data 命令可用于管理 Azure 机器学习数据资产。

示例

示例 GitHub 存储库中提供了示例。 下面显示了几个:

YAML:数据存储文件

$schema: https://azuremlschemas.azureedge.net/latest/data.schema.json
name: cloud-file-example
description: Data asset created from file in cloud.
type: uri_file
path: azureml://datastores/workspaceblobstore/paths/example-data/titanic.csv

YAML:数据存储文件夹

$schema: https://azuremlschemas.azureedge.net/latest/data.schema.json
name: cloud-folder-example
description: Data asset created from folder in cloud.
type: uri_folder
path: azureml://datastores/workspaceblobstore/paths/example-data/

YAML:HTTPS 文件

$schema: https://azuremlschemas.azureedge.net/latest/data.schema.json
name: cloud-file-https-example
description: Data asset created from a file in cloud using https URL.
type: uri_file
path: https://account-name.blob.core.chinacloudapi.cn/container-name/example-data/titanic.csv

YAML:HTTPS 文件夹

$schema: https://azuremlschemas.azureedge.net/latest/data.schema.json
name: cloud-folder-https-example
description: Dataset created from folder in cloud using https URL.
type: uri_folder
path: https://account-name.blob.core.chinacloudapi.cn/container-name/example-data/

YAML:WASBS 文件

$schema: https://azuremlschemas.azureedge.net/latest/data.schema.json
name: cloud-file-wasbs-example
description: Data asset created from a file in cloud using wasbs URL.
type: uri_file
path: wasbs://account-name.blob.core.chinacloudapi.cn/container-name/example-data/titanic.csv

YAML:WASBS 文件夹

$schema: https://azuremlschemas.azureedge.net/latest/data.schema.json
name: cloud-folder-wasbs-example
description: Data asset created from folder in cloud using wasbs URL.
type: uri_folder
path: wasbs://account-name.blob.core.chinacloudapi.cn/container-name/example-data/

YAML:本地文件

$schema: https://azuremlschemas.azureedge.net/latest/data.schema.json
name: local-file-example-titanic
description: Data asset created from local file.
type: uri_file
path: sample-data/titanic.csv

YAML:本地文件夹

$schema: https://azuremlschemas.azureedge.net/latest/data.schema.json
name: local-folder-example-titanic
description: Dataset created from local folder.
type: uri_folder
path: sample-data/

后续步骤