CLI (v2) Azure Blob 資料存放區 YAML 架構

適用於:Azure CLI ml 延伸模組 v2 (目前)

請參閱 上的 https://azuremlschemas.azureedge.net/latest/azureBlob.schema.json來源 JSON 架構。

注意

本文件中詳述的 YAML 語法是以最新版 ML CLI v2 延伸模組的 JSON 結構描述為基礎。 此語法僅保證能與最新版的 ML CLI v2 延伸模組搭配運作。 您可以在 https://azuremlschemasprod.azureedge.net/ 找到舊版延伸模組的結構描述。

YAML 語法

機碼 類型 描述 允許的值 預設值
$schema string YAML 結構描述。 如果您使用 Azure 機器學習 Visual Studio Code 擴充功能來撰寫 YAML 檔案,請在檔案頂端包含 $schema 以叫用架構和資源完成。
type 字串 必要。 數據存放區類型。 azure_blob
name 字串 必要。 數據存放區名稱。
description 字串 數據存放區描述。
tags object 數據存放區標籤字典。
account_name 字串 必要。 Azure 記憶體帳戶名稱。
container_name 字串 必要。 容器名稱。
endpoint 字串 記憶體服務的端點後綴,用於建立記憶體帳戶端點 URL。 它會結合記憶體帳戶名稱和 endpoint。 範例記憶體帳戶 URL: https://<storage-account-name>.blob.core.windows.net core.windows.net
protocol 字串 線上至容器的通訊協定。 https, wasbs https
credentials object 線上至 Azure 記憶體帳戶認證認證認證。 帳戶金鑰或共用存取簽章 (SAS) 令牌將會運作。 工作區金鑰保存庫會儲存認證秘密。
credentials.account_key 字串 用於記憶體帳戶存取的帳戶金鑰。 如果credentials指定 ,則需要 或 credentials.account_keycredentials.sas_token 的其中一個 。
credentials.sas_token 字串 用於存取記憶體帳戶的SAS令牌。 如果credentials指定 ,則需要 或 credentials.account_keycredentials.sas_token 的其中一個 。

備註

您可以使用 az ml datastore 命令來管理 Azure 機器學習 資料存放區。

範例

如需範例,請流覽 此 GitHub 資源 。 這裡顯示數個:

YAML:身分識別型存取

$schema: https://azuremlschemas.azureedge.net/latest/azureBlob.schema.json
name: blob_credless_example
type: azure_blob
description: Credential-less datastore pointing to a blob container.
account_name: mytestblobstore
container_name: data-container

YAML:帳戶密鑰

$schema: https://azuremlschemas.azureedge.net/latest/azureBlob.schema.json
name: blob_example
type: azure_blob
description: Datastore pointing to a blob container.
account_name: mytestblobstore
container_name: data-container
credentials:
  account_key: XXXxxxXXXxXXXXxxXXXXXxXXXXXxXxxXxXXXxXXXxXXxxxXXxxXXXxXxXXXxxXxxXXXXxxxxxXXxxxxxxXXXxXXX

YAML:wasbs 通訊協定

$schema: https://azuremlschemas.azureedge.net/latest/azureBlob.schema.json
name: blob_protocol_example
type: azure_blob
description: Datastore pointing to a blob container using wasbs protocol.
account_name: mytestblobstore
protocol: wasbs
container_name: data-container
credentials:
  account_key: XXXxxxXXXxXXXXxxXXXXXxXXXXXxXxxXxXXXxXXXxXXxxxXXxxXXXxXxXXXxxXxxXXXXxxxxxXXxxxxxxXXXxXXX

YAML:sas 令牌

$schema: https://azuremlschemas.azureedge.net/latest/azureBlob.schema.json
name: blob_sas_example
type: azure_blob
description: Datastore pointing to a blob container using SAS token.
account_name: mytestblobstore
container_name: data-container
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

下一步