az ml datastore
Note
此参考是 Azure CLI(版本 2.15.0 或更高版本) 的 ml 扩展的一部分。 该扩展将在首次运行 az ml datastore 命令时自动安装。 了解更多关于扩展的信息。
管理 Azure ML 数据存储。
Azure ML 数据存储安全地将 Azure 存储服务链接到工作区,以便访问存储,而无需将连接信息硬编码到脚本中。 连接机密(如存储服务的身份验证凭据)存储在工作区的密钥库中。
创建工作区时,会自动创建Azure 存储帐户作为关联的资源。 Blob 容器在此帐户中创建,其连接信息存储为名为“workspaceblobstore”的数据存储。 这充当工作区的默认数据存储,Blob 容器用于存储工作区项目和机器学习作业日志和输出。
命令
| 名称 | 说明 | 类型 | Status |
|---|---|---|---|
| az ml datastore create |
创建数据存储。 |
Extension | GA |
| az ml datastore delete |
删除数据存储。 |
Extension | GA |
| az ml datastore list |
列出工作区中的数据存储。 |
Extension | GA |
| az ml datastore mount |
将特定数据存储装载到本地路径。 目前仅支持 Linux。 |
Extension | Preview |
| az ml datastore show |
显示数据存储的详细信息。 |
Extension | GA |
| az ml datastore update |
更新数据存储。 |
Extension | GA |
az ml datastore create
创建数据存储。
这会将基础 Azure 存储服务连接到工作区。 当前可以通过创建数据存储连接到的存储服务类型包括 Azure Blob 存储、Azure 文件共享、Azure Data Lake Storage Gen1 和 Azure Data Lake Storage Gen2。
az ml datastore create --file
--resource-group
--workspace-name
[--name]
[--set]
示例
从 YAML 规范文件创建数据存储
az ml datastore create --file blobstore.yml --resource-group my-resource-group --workspace-name my-workspace
必需参数
包含 Azure ML 数据存储规范的 YAML 文件的本地路径。 数据存储的 YAML 参考文档位于:https://aka.ms/ml-cli-v2-datastore-blob-yaml-reference、https://aka.ms/ml-cli-v2-datastore-file-yaml-reference、https://aka.ms/ml-cli-v2-datastore-data-lake-gen1-yaml-reference、https://aka.ms/ml-cli-v2-datastore-data-lake-gen2-yaml-reference。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
数据存储的名称。 这会覆盖提供给 --file/-f 的 YAML 文件中的“name”字段。
通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=value。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml datastore delete
删除数据存储。
这会从工作区中删除与存储服务的连接信息,但不删除存储中的基础数据。
az ml datastore delete --name
--resource-group
--workspace-name
必需参数
数据存储的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml datastore list
列出工作区中的数据存储。
az ml datastore list --resource-group
--workspace-name
[--max-results]
示例
使用 --query 参数对命令结果执行 JMESPath 查询,列出工作区中的所有数据存储。
az ml datastore list --query "[].{Name:name}" --output table --resource-group my-resource-group --workspace-name my-workspace
必需参数
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
要返回的最大结果数。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml datastore mount
此命令处于预览阶段,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
将特定数据存储装载到本地路径。 目前仅支持 Linux。
az ml datastore mount --path
[--mode]
[--mount-point]
[--persistent]
[--resource-group]
[--workspace-name]
示例
按名称装载数据存储
az ml datastore mount --mount-point /mnt/my-datastore --mode ro_mount --path my-datastore
通过数据存储短格式 URL 装载数据存储
az ml datastore mount --mount-point /mnt/my-datastore --mode ro_mount --path azureml://datastores/my-datastore
通过数据存储长格式 URL 装载数据存储
az ml datastore mount --mount-point /mnt/my-datastore --mode ro_mount --path azureml://subscriptions/my-sub-id/resourcegroups/my-rg/providers/Microsoft.MachineLearningServices/workspaces/myworkspace/datastores/my-datastore
必需参数
要装载的数据存储路径,采用 <datastore_name> 或 azureml://datastores/<datastore_name>的形式。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
装载模式,ro_mount(只读)或 rw_mount(读写)。
| 属性 | 值 |
|---|---|
| 默认值: | ro_mount |
用作装入点的本地路径。
| 属性 | 值 |
|---|---|
| 默认值: | /home/azureuser/mount/data |
使装载在重新启动时保持保留。 仅在计算实例上受支持。
| 属性 | 值 |
|---|---|
| 默认值: | False |
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml datastore show
显示数据存储的详细信息。
az ml datastore show --name
--resource-group
--workspace-name
必需参数
数据存储的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
az ml datastore update
更新数据存储。
可以更新“description”、“tags”和“credential”属性。
az ml datastore update --resource-group
--workspace-name
[--add]
[--file]
[--force-string]
[--name]
[--remove]
[--set]
必需参数
资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。
Azure ML 工作区的名称。 可以使用 配置默认工作区 az configure --defaults workspace=<name>。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>。
| 属性 | 值 |
|---|---|
| Parameter group: | Generic Update Arguments |
| 默认值: | [] |
包含 Azure ML 数据存储规范的 YAML 文件的本地路径。 数据存储的 YAML 参考文档位于:https://aka.ms/ml-cli-v2-datastore-blob-yaml-reference、https://aka.ms/ml-cli-v2-datastore-file-yaml-reference、https://aka.ms/ml-cli-v2-datastore-data-lake-gen1-yaml-reference、https://aka.ms/ml-cli-v2-datastore-data-lake-gen2-yaml-reference。
使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。
| 属性 | 值 |
|---|---|
| Parameter group: | Generic Update Arguments |
| 默认值: | False |
数据存储的名称。 这会覆盖提供给 --file/-f 的 YAML 文件中的“name”字段。
从列表中删除属性或元素。 示例: --remove property.list <indexToRemove> OR --remove propertyToRemove.
| 属性 | 值 |
|---|---|
| Parameter group: | Generic Update Arguments |
| 默认值: | [] |
通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>。
| 属性 | 值 |
|---|---|
| Parameter group: | Generic Update Arguments |
| 默认值: | [] |
全局参数
提高日志记录详细程度以显示所有调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
| 属性 | 值 |
|---|---|
| 默认值: | False |
输出格式。
| 属性 | 值 |
|---|---|
| 默认值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
| 属性 | 值 |
|---|---|
| 默认值: | False |