CLI (v2) Azure Blob 資料存放區 YAML 結構描述

適用於:Azure CLI ML 延伸模組第 2 版 (目前)

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

注意

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

YAML 語法

索引鍵 類型 描述 允許的值 預設值
$schema 字串 YAML 結構描述。 如果您使用 Azure Machine Learning Visual Studio Code 擴充功能來撰寫 YAML 檔案,如果您在檔案頂端包含 $schema 架構和資源完成,則可以叫用架構和資源完成。
type 字串 必要。 資料存放區類型。 azure_blob
name 字串 必要。 資料存放區名稱。
description string 資料存放區描述。
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 string 用於儲存體帳戶存取的帳戶金鑰。 如果指定 credentials,則需要 credentials.account_keycredentials.sas_token 的其中一個。
credentials.sas_token 字串 用來存取儲存體帳戶的 SAS 權杖。 如果指定 credentials,則需要 credentials.account_keycredentials.sas_token 的其中一個。

備註

您可以使用 az ml datastore 命令來管理 Azure Machine Learning 資料存放區。

範例

請參閱 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

後續步驟