參加你附近的 ,瞭解 VS Code 中的 AI 輔助開發。

Visual Studio Code 的 Azure 資源

Azure 資源擴充套件允許你直接在 VS Code 中無縫檢視和管理 Azure 資源。它還提供了身份驗證和管理 Azure 賬戶和租戶的功能。

如何登入 Azure 賬戶

Azure 資源擴充套件使用 VS Code 內建的 Microsoft 身份驗證提供程式來透過 Azure 進行身份驗證。透過選擇 Azure 資源檢視中的“登入 Azure…”項來登入。

Screenshot that shows where to sign in to your Azure account

你還可以使用 Azure 資源擴充套件提供的“Azure: 登入”命令來登入。

Screenshot that shows where to sign in to an Azure account from the command palette

如何登出

在 VS Code 視窗左下角的“賬戶”選單中登出。

Screenshot that shows where to sign out of an Azure account

篩選訂閱

你可以透過選擇任何訂閱上的篩選圖示來篩選顯示的訂閱。

Screenshot that shows where to filter your subscriptions

篩選後的訂閱儲存在 azureResourceGroups.selectedSubscriptions 設定中。

賬戶與租戶檢視

在 Azure 資源擴充套件中,你可以使用“賬戶與租戶”檢視來管理和驗證賬戶和租戶。

Screenshot that shows the Accounts & Tenants view

篩選租戶

你還可以透過勾選和取消勾選租戶來篩選租戶。這將導致資源檢視和訂閱篩選器中的訂閱根據租戶檢視中已勾選/未勾選的租戶進行篩選。

Accounts & Tenants view

驗證租戶

在“賬戶與租戶”檢視中,你可以檢視與你的賬戶關聯的所有租戶。許多租戶需要多重身份驗證 (MFA) 才能訪問它們。需要多重身份驗證的租戶在懸停在其上方時,右側會有一個登入按鈕。

Screenshot that shows where to authenticate your tenants

你可以透過導航到“賬戶與租戶”檢視並選擇租戶右側的登入按鈕,或者透過簡單地勾選一個未驗證的租戶來驗證特定的租戶。

多賬戶支援

在“賬戶與租戶”檢視中,你可以透過選擇檢視右上角的 + 圖示來登入新賬戶。

Screenshot that shows where to sign in to multiple Azure Accounts

使用主權雲

要連線到主權雲,你可以選擇“賬戶與租戶”檢視右側的齒輪圖示。

Sovereign Clouds

這將顯示一個可供選擇的主權雲列表。

Screenshot that shows where to connect to a sovereign cloud

一旦選擇,Microsoft-sovereign-cloud.environment 設定會自動設定。“資源”和“賬戶與租戶”檢視也會重新整理,允許你登入到你的主權雲賬戶。