WorkspaceConnection 類別

注意

這是實驗性類別,隨時可能會變更。 請參閱 https://aka.ms/azuremlexperimental 以取得詳細資訊。

Azure ML 工作區連線提供安全的方式來儲存連線與外部資源連線和互動所需的驗證和設定資訊。

繼承
azure.ai.ml.entities._resource.Resource
WorkspaceConnection

建構函式

WorkspaceConnection(*, target: str, type: str, credentials: PatTokenConfiguration | SasTokenConfiguration | UsernamePasswordConfiguration | ManagedIdentityConfiguration | ServicePrincipalConfiguration, metadata: Dict[str, Any] | None = None, **kwargs)

參數

name
str
必要

工作區連線的名稱。

target
str
必要

外部資源的 URL 或 ARM 資源識別碼。

credentials
<xref:Union>[PatTokenConfiguration, <xref:azure.ai.ml.entities.SasTokenConfiguration,azure.ai.ml.entities.UsernamePasswordConfiguration>, <xref:azure.ai.ml.entities.ManagedIdentityConfigurationazure.ai.ml.entities.ServicePrincipalConfiguration>]
必要

向外部資源驗證的認證。

type
<xref:<xref:The type of workspace connection>, <xref:possible values are:>[<xref:"git">, <xref:"python_feed">, <xref:"container_registry">, <xref:"feature_store">]>
必要

此連線的外部資源類別。

方法

dump

以 yaml 格式將工作區連線規格傾印到檔案中。

dump

以 yaml 格式將工作區連線規格傾印到檔案中。

dump(dest: str | PathLike | IO, **kwargs) -> None

參數

dest
<xref:Union>[<xref:PathLike>, str, <xref:IO>[<xref:AnyStr>]]
必要

接收此工作區連線規格的目的地。必須是本機檔案的路徑,或已開啟的檔案資料流程。 如果 dest 是檔案路徑,將會建立新的檔案,如果檔案存在,則會引發例外狀況。 如果 dest 是開啟的檔案,則會將檔案直接寫入,如果檔案無法寫入,則會引發例外狀況。

屬性

credentials

工作區連線的認證。

]

傳回

工作區連線的認證。

傳回類型

<xref:Union>[<xref:PatTokenCredentialsConfiguration,SasTokenCredentialsConfiguration,UsernamePasswordCredentialsConfiguration,azure.ai.ml.entities.ManagedIdentityConfiguration,ServicePrincipalCredentialsConfiguration,>

metadata

工作區連線的中繼資料。

傳回

工作區連線的中繼資料。

傳回類型

<xref:Dict>[str, <xref:Any>]

target

工作區連線的目標 URL。

傳回

工作區連線的目標。

傳回類型

str

type

支援的工作區連線類型為 'git'、'python_feed' 和 'container_registry'。

傳回

作業類型。

傳回類型

str