用于 Visual Studio Code 的 Azure 资源

Azure 资源扩展允许您直接在 VS Code 中无缝查看和管理 Azure 资源。它还提供了对 Azure 账户和租户进行身份验证和管理的功能。

如何登录 Azure 账户

Azure 资源扩展使用内置的 VS Code Microsoft 身份验证提供程序来验证 Azure 身份。通过在“Azure 资源”视图中选择登录 Azure… (Sign in to Azure…)项即可登录。

Screenshot that shows where to sign in to your Azure account

您也可以使用 Azure 资源扩展提供的 Azure: 登录 (Azure: Sign in) 命令进行登录。

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 在 VS Code 中打开 在 VS Code Insiders 中打开 设置中。

账户与租户视图

在 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 在 VS Code 中打开 在 VS Code Insiders 中打开 设置将自动完成配置。“资源”和“账户与租户”视图也会刷新,允许您登录您的主权云账户。

© . This site is unofficial and not affiliated with Microsoft.