在 VS Code 中试试

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 设置将自动设置。“资源”和“帐户和租户”视图也会刷新,使你可以登录到主权云帐户。