共用方式為


CLI (v2) Foundry Tools 連線 YAML 架構

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

注意

本文件中詳述的 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 字串 必要。 連線類型。 azure_ai_services azure_ai_services
is_shared 布爾值 如果在中樞內的其他專案之間共用連線,則為 true;否則為 false true
endpoint 字串 必要。 端點的 URL。
api_key 字串 用來驗證連線的 API 金鑰。 如果未提供,則會透過Microsoft Entra ID(無認證驗證)來驗證連線。
ai_services_resource_id 字串 必要。 Foundry Tools 資源的完整 Azure 資源 ID。

備註

有兩種方式可以建立與 Foundry Tools 的連結:

  • 除了 Azure AI 搜尋外,所有 Foundry 工具都共用一個連線。
  • 每個 Foundry 工具各有一個連線。

本文描述的架構是針對 除 Azure AI Search 外所有 Foundry 工具的單一連線

雖然這些 az ml connection 指令可用於管理 Azure Machine Learning 與 Microsoft Foundry 連線,但 Foundry 工具的連線是專屬於 Foundry 的。

範例

這些範例的格式為 YAML 檔案,並從 CLI 使用。 例如: az ml connection create -f <file-name>.yaml

YAML:API 金鑰

#AzureAIServiceConnection.yml

name: myazai_ei
type: azure_ai_services
endpoint: https://contoso.cognitiveservices.azure.com/
api_key: XXXXXXXXXXXXXXX

YAML:Microsoft Entra ID

#AzureAIServiceConnection.yml

name: myazai_apk
type: azure_ai_services
endpoint: https://contoso.cognitiveservices.azure.com/

下一步