你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

使用 Azure 门户管理 SQL Server VM

适用于:Azure 上的 SQL Server

Azure 门户中,SQL 虚拟机资源是一个独立的管理服务,用于管理已注册到 SQL Server IaaS 代理扩展的 Azure 虚拟机 (VM) 上的 SQL Server。 可以使用该资源同时查看所有 SQL Server VM,以及修改专用于 SQL Server 的设置:

Screenshot of accessing the SQL virtual machines resource in the Azure portal.

SQL 虚拟机资源管理点不同于用于管理基础 VM 的虚拟机资源,例如启动、停止或重启它。

先决条件

SQL 虚拟机资源只可用于已注册到 SQL IaaS 代理扩展的 SQL Server VM。

访问资源

要访问 SQL 虚拟机资源,请执行以下步骤:

  1. 打开 Azure 门户

  2. 选择“所有服务”。

  3. 在搜索框中输入“SQL 虚拟机”。

  4. (可选):选择“SQL 虚拟机”旁边的星号将此选项添加到“收藏夹”菜单 。

  5. 选择“SQL 虚拟机”。

    Screenshot of the Azure portal, All services selected, and the search box highlighted.

  6. 门户列出了所选订阅中可用的所有 SQL Server VM。 选择要管理的那一个,以打开 SQL 虚拟机资源。 如果未显示 SQL Server VM,请使用搜索框,并确保已选择正确的订阅。

    Screenshot of the Azure portal, the SQL virtual machines resource page, with a VM selected.

选择你的 SQL Server VM 可打开该 SQL 虚拟机资源。

提示

SQL 虚拟机资源用于专用的 SQL Server 设置。 在“概述”页上,选择“虚拟机”下的 VM 名称,以打开特定于基础虚拟机的设置。

概述页

SQL 虚拟机资源的“概述”页提供有关 SQL Server VM 的基本信息,例如资源组、位置、许可证类型、基础 Azure 虚拟机的名称和存储利用率指标。

还可以在“扩展运行状况”下查看 SQL Iaas 代理扩展的状态。 如果状态为“运行不正常”或“失败”,则可以从“通知”选项卡中找到详细信息。

通知”选项卡显示 SQL 最佳做法评估中的信息,以及有关扩展运行状况的问题。

Screenshot of the Azure portal, the overview pane of the SQL virtual machines resource.

许可证和产品版本

使用 SQL 虚拟机资源的“配置”页,为用于灾难恢复的免费 Azure 副本将 SQL Server 许可元数据更改为“即付即用”、“Azure 混合权益”或“HA/DR”。

Screenshot of the Azure portal, SQL virtual machines resource, showing where to change the version and edition of SQL Server VM metadata.

也可以从“配置”页修改 SQL Server 的产品版本,例如 Enterprise、Standard 或 Developer。

只有在已从内部将 SQL Server 的发行版本和产品版本修改为 VM 后,才支持在 Azure 门户中更改许可证和产品版本元数据。 若要了解详细信息,请参阅:在 Azure VM 上更改 SQL Server 的发行版本产品版本

存储配置

注意

目前不支持对 Azure 门户中 SQL Server VM 的 高级 SSD v2 进行更改,因此 SQL 虚拟机资源的存储配置页显示高级 SSD v2 磁盘无法扩展。 查看“调整性能”以了解详细信息。

使用 SQL 虚拟机资源的“存储配置”页可以扩展数据、日志和 tempdb 驱动器。 有关指南,请查看存储配置存储:Azure VM 上的 SQL Server 的性能最佳做法

例如,可以扩展存储:

Screenshot of the Azure portal, SQL virtual machines resource, showing where to extend storage.

注意

存储仅对于从 Azure 市场中的 SQL Server 映像部署的 SQL Server VM 可扩展,当前不支持高级 SSD v2 磁盘。

更新

在 Azure VM 上自动修补 SQL Server 时,有两个不同选项 – 目前处于预览状态的新的集成 Azure 更新管理器 体验,以及现有的 自动修补 功能。

更新管理器让你可以选择大规模应用于多个 SQL Server VM 的更新和修补程序,包括“累积更新”。 自动修补让你可以管理单个 VM 的修补程序,并且仅应用标记为“关键”或“重要”的更新(不包括 SQL Server 的累积更新)。

请选择最适合业务需求的体验,因为同时启用两者可能导致意外行为、计划冲突,以及无意中在维护时段外应用修补程序。

要使用更新管理器,请在资源菜单中选择“设置”下的“更新”,确保已禁用自动修补,然后在导航栏中选择“试用 Azure 更新管理器”,将更新管理器集成到“更新”页。 为任何 VM 启用此功能后,所有其他 SQL Server VM 也将集成新体验,除非已为任何特定 VM 启用自动修补功能。 如果看到的是“退出新体验”而不是“试用 Azure 更新管理器”,则代表已使用集成的“Azure 更新管理器”体验。

Screenshot of the updates page in the SQL virtual machines resource in the Azure portal with Try Azure Update Manager highlighted.

如果以前从未启用过更新管理器,那么要启用自动修补,请在“更新”页上选择“启用”。 否则,若要返回到“自动修补”页,请选择“退出新体验”:

Screenshot of the updates page in the SQL virtual machines resource in the Azure portal with leave new experience highlighted.

备份

使用 SQL 虚拟机资源的“备份”页可以配置自动备份设置,例如保留期、要使用的存储帐户、加密、是否备份系统数据库和备份计划。

Screenshot of the Azure portal, SQL virtual machines resource, showing where to configure automated backup and schedule.

有关详细信息,请参阅自动修补

高可用性

使用 Azure 门户配置可用性组后,使用 SQL 虚拟机资源的“高可用性”页来监视现有 Always On 可用性组的运行状况。

Screenshot of the Azure portal, SQL virtual machines resource, showing where to check the status of your availability group from the high availability page.

SQL 最佳做法评估

使用 SQL 虚拟机资源的“SQL 最佳做法评估”页来评估 SQL Server VM 的运行状况。 启用该功能后,将扫描 SQL Server 实例和数据库,并显示改进性能(索引、统计数据、跟踪标志等)和确定缺少的最佳做法配置的建议。

若要了解详细信息,请参阅 Azure VM 上适用于 SQL Server 的 SQL 最佳做法评估

安全性配置

使用 SQL 虚拟机资源的“安全配置”页可以配置 SQL Server 安全设置(例如 Azure Key Vault 集成、最低特权模式);如果位于 SQL Server 2022 上,则为 Microsoft Entra ID(以前称为 Azure Active Directory身份验证

Screenshot of the Azure portal, the SQL Server security page, where you can enable authentication.

有关详细信息,请参阅安全最佳做法

注意

2023 年 4 月,Azure 门户中删除了在部署 SQL Server VM 后更改连接和 SQL Server 身份验证设置的功能。 你仍然可以在 SQL Server VM 部署期间指定这些设置,或使用 SQL Server Management Studio (SSMS) 在部署后从 SQL Server VM 中手动更新这些设置。

Defender for Cloud

使用 SQL 虚拟机资源的“Defender for SQL”页面,在 SQL 虚拟机窗格中直接查看 Defender for Cloud 建议。 启用 Microsoft Defender for SQL 以利用此功能。

Screenshot of the Azure portal, SQL virtual machines resource, showing where to configure SQL Server Defender for Cloud settings.

SQL IaaS 代理扩展设置

在“SQL IaaS 代理扩展设置”页中,可以 修复扩展并启用自动升级,以确保每月自动接收该扩展的更新。

Screenshot of the SQL IaaS Agent Extension Settings page for your SQL virtual machines resource in the Azure portal.