注意
本文档中详细介绍的 YAML 语法基于最新版本的 ML CLI v2 扩展的 JSON 架构。 此语法必定仅适用于最新版本的 ML CLI v2 扩展。 可以在 https://azuremlschemasprod.azureedge.net/ 上查找早期扩展版本的架构。
YAML 语法
| 密钥 | 类型 | 说明 | 允许的值 | 默认值 |
|---|---|---|---|---|
$schema |
字符串 | YAML 架构。 如果使用 Azure 机器学习 Visual Studio Code 扩展来创作 YAML 文件,请在该文件的顶部添加 $schema 以调用架构和资源完成。 |
||
name |
字符串 | 必需。 连接名称。 | ||
description |
字符串 | 连接描述。 | ||
tags |
对象 | 连接标记字典。 | ||
type |
字符串 | 必需。 连接类型。 | git |
git |
is_shared |
布尔 | 如果中心内其他项目共享连接,则为 true;否则,为 false。 |
true |
|
target |
字符串 | GitHub 存储库的 URL。 | ||
credentials |
对象 | 执行基于凭据的身份验证,以访问存储帐户。
个人访问令牌。 使用公共存储库时,请勿指定 credentials。 |
||
credentials.type |
字符串 | 要使用的身份验证类型。 | pat |
|
credentials.pat |
字符串 | 用于身份验证时的个人访问令牌。 |
注解
这些 az ml connection 命令可用于管理 Azure 机器学习和 Microsoft Foundry 连接。
示例
这些示例将以 YAML 文件的形式显示,并通过 CLI 使用。 例如 az ml connection create -f <file-name>.yaml。
YAML:个人访问令牌
#Connection.yml
name: test_ws_conn_git_pat
type: git
target: https://github.com/contoso/contosorepo
credentials:
type: pat
pat: dummy_pat
YAML:无凭据
#Connection.yml
name: git_no_cred_conn
type: git
target: https://https://github.com/contoso/contosorepo
Azure CLI ml 扩展 v2(当前)