注意
本文件中詳述的 YAML 語法是以最新版 ML CLI v2 延伸模組的 JSON 結構描述為基礎。 此語法僅保證能與最新版的 ML CLI v2 延伸模組搭配運作。 您可以在 https://azuremlschemasprod.azureedge.net/ 找到舊版延伸模組的結構描述。
YAML 語法
| 機碼 | 類型 | 描述 | 允許的值 | 預設值 |
|---|---|---|---|---|
$schema |
字串 | YAML 結構描述。 如果您使用 Azure Machine Learning Visual Studio Code 延伸模組以撰寫 YAML 檔案,請在檔案頂端包含 $schema 以叫用結構描述和資源完成。 |
||
name |
字串 | 必要。 連線名稱。 | ||
description |
字串 | 連線描述。 | ||
tags |
物件 | 連線標籤字典。 | ||
type |
字串 | 必要。 連線類型。 | python_feed |
python_feed |
is_shared |
布爾值 | 如果在中樞內的其他專案之間共用連線,則為 true;否則為 false。 |
true |
|
target |
字串 | 端點的 URL。 | ||
credentials |
物件 | 存取儲存體帳戶的認證型驗證。 您可以使用個人存取權杖或使用者名稱和密碼。 請勿在使用公用 Python 摘要時指定 credentials。 |
||
credentials.type |
字串 | 要使用的驗證類型。 |
pat、username_password |
|
credentials.pat |
字串 | 要用來驗證的個人存取權杖。 | ||
credentials.username |
字串 | 要用來驗證的使用者名稱。 | ||
credentials.password |
字串 | 要用來驗證的密碼。 |
備註
雖然這些 az ml connection 指令可以用來管理 Azure Machine Learning 和 Microsoft Foundry 的連線。
範例
這些範例的格式為 YAML 檔案,並從 CLI 使用。 例如: az ml connection create -f <file-name>.yaml 。
YAML:個人存取權杖
#Connection.yml
name: test_ws_conn_python_pat
type: python_feed
target: https://test-feed.com
credentials:
type: pat
pat: dummy_pat
YAML:使用者名稱和密碼
name: test_ws_conn_python_user_pass
type: python_feed
target: https://test-feed.com
credentials:
type: username_password
username: john
password: pass
YAML:不使用認證
name: test_ws_conn_python_no_cred
type: python_feed
target: https://test-feed.com3
