CLI (v2) Azure 文件存储数据存储 YAML 架构

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

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

注意

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

YAML 语法

密钥 类型 说明 允许的值 默认值
$schema 字符串 YAML 架构。 如果使用 Azure 机器学习 VS Code 扩展来创作 YAML 文件,请在该文件的顶部添加 $schema 以调用架构和资源完成。
type string 必需。 数据存储类型。 azure_file
name 字符串 必需。 数据存储名称。
description 字符串 数据存储说明。
tags object 数据存储标记字典。
account_name 字符串 必需。 Azure 存储帐户名称。
file_share_name 字符串 必需。 文件共享名称。
endpoint string 存储服务的终结点后缀。 这用于创建存储帐户终结点 URL。 它将存储帐户名称和 endpoint 组合在一起。 示例存储帐户 URL:https://<storage-account-name>.file.core.chinacloudapi.cn core.chinacloudapi.cn
protocol 字符串 用于连接到文件共享的协议。 https https
credentials object 用于连接到 Azure 存储帐户的基于凭据的身份验证凭据。 提供帐户密钥或共享访问签名 (SAS) 令牌。 凭据机密将存储在工作区密钥保管库中。
credentials.account_key string 用于访问存储帐户的帐户密钥。 如果指定credentials,则需要其中一个credentials.account_keycredentials.sas_token
credentials.sas_token string 用于访问存储帐户的 SAS 令牌。 如果指定了 credentials,则 credentials.account_keycredentials.sas_token 之一是必需的。

备注

az ml datastore 命令可用于管理 Azure 机器学习数据存储。

示例

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

YAML:帐户密钥

$schema: https://azuremlschemas.azureedge.net/latest/azureFile.schema.json
name: file_example
type: azure_file
description: Datastore pointing to an Azure File Share.
account_name: mytestfilestore
file_share_name: my-share
credentials:
  account_key: XxXxXxXXXXXXXxXxXxxXxxXXXXXXXXxXxxXXxXXXXXXXxxxXxXXxXXXXXxXXxXXXxXxXxxxXXxXXxXXXXXxXxxXX

YAML:SAS 令牌

$schema: https://azuremlschemas.azureedge.net/latest/azureFile.schema.json
name: file_sas_example
type: azure_file
description: Datastore pointing to an Azure File Share using SAS token.
account_name: mytestfilestore
file_share_name: my-share
credentials:
  sas_token: ?xx=XXXX-XX-XX&xx=xxxx&xxx=xxx&xx=xxxxxxxxxxx&xx=XXXX-XX-XXXXX:XX:XXX&xx=XXXX-XX-XXXXX:XX:XXX&xxx=xxxxx&xxx=XXxXXXxxxxxXXXXXXXxXxxxXXXXXxxXXXXXxXXXXxXXXxXXxXX

后续步骤