快速入门:创建 Azure SQL 数据库托管实例Quickstart: Create an Azure SQL Database managed instance

本快速入门逐步说明如何在 Azure 门户中创建 Azure SQL 数据库托管实例This quickstart walks you through how to create an Azure SQL Database managed instance in Azure portal.

Important

有关限制,请参阅支持的区域For limitations, see Supported regions.

登录到 Azure 门户Sign in to Azure portal

如果没有 Azure 订阅,可创建一个 1 元人民币试用帐户If you don't have an Azure subscription, create a 1rmb trial account.

登录到 Azure 门户Sign in to Azure portal.

创建托管实例Create a managed instance

以下步骤展示了如何创建托管实例:The following steps show you how to create a managed instance:

  1. 在 Azure 门户的左上角,选择“创建资源” 。Select Create a resource in the upper-left corner of the Azure portal.

  2. 找到“托管实例”,然后选择“Azure SQL 托管实例” 。Locate managed instance, and then select Azure SQL Managed Instance.

  3. 选择“创建” 。Select Create.

    创建托管实例

  4. 使用“创建 Azure SQL 数据库托管实例”预配窗体上的选项卡添加必需信息和可选信息。 Use the tabs on the Create Azure SQL Database Managed Instance provisioning form to add required and optional information. 以下部分介绍这些选项卡。The following sections describe these tabs.

基础知识Basics

  • 填写“基本信息”选项卡中的必需信息。 这是预配托管实例所需的最少量信息。Fill out mandatory information required on the Basics tab. This is a minimum set of information required to provision a managed instance.

    用于创建托管实例的“基本信息”选项卡

    参考下表来填写此选项卡中的所需信息。Use the table below as a reference for information required at this tab.

    设置Setting 建议的值Suggested value 说明Description
    订阅Subscription 你的订阅。Your subscription. 你有权在其中创建新资源的订阅。A subscription that gives you permission to create new resources.
    资源组Resource group 新的或现有的资源组。A new or existing resource group. 有关有效的资源组名称,请参阅 Naming rules and restrictions(命名规则和限制)。For valid resource group names, see Naming rules and restrictions.
    托管实例名称Managed instance name 任何有效的名称。Any valid name. 请参阅命名规则和限制,了解什么是有效的名称。For valid names, see Naming rules and restrictions.
    区域Region 要在其中创建托管实例的区域。The region in which you want to create the managed instance. 有关区域的信息,请参阅 Azure 区域For information about regions, see Azure regions.
    托管实例管理员登录名Managed instance admin login 任何有效的用户名。Any valid username. 请参阅命名规则和限制,了解什么是有效的名称。For valid names, see Naming rules and restrictions. 不要使用“serveradmin”,因为这是保留的服务器级角色。Don't use "serveradmin" because that's a reserved server-level role.
    密码Password 任何有效的密码。Any valid password. 密码必须至少 16 个字符,且符合定义的复杂性要求The password must be at least 16 characters long and meet the defined complexity requirements.
  • 选择“配置托管实例”,以设置计算和存储资源的大小并查看定价层。 Select Configure Managed Instance to size compute and storage resources and to review the pricing tiers. 使用滑块或文本框指定存储量和虚拟核心数。Use the sliders or text boxes to specify the amount of storage and the number of virtual cores. 完成后,选择“应用”以保存所做的选择。 When you're finished, select Apply to save your selection.

    托管实例窗体

  • 若要在创建托管实例之前查看所做的选择,可选择“查看 + 创建”。 To review your choices before you create a managed instance, you can select Review + create. 也可配置网络选项,方法是选择“下一步: 网络”。Or, configure networking options by selecting Next: Networking.

网络Networking

  • 填写“网络”选项卡中的可选信息。 如果省略此信息,门户会应用默认设置。Fill out optional information on the Networking tab. If you omit this information, the portal will apply default settings.

    用于创建托管实例的“网络”选项卡

    参考下表来填写此选项卡中的所需信息。Use the table below as a reference for information required at this tab.

    设置Setting 建议的值Suggested value 说明Description
    虚拟网络Virtual network 选择“创建新的虚拟网络”或有效的虚拟网络和子网 。Select either Create new virtual network or a valid virtual network and subnet. 如果网络或子网不可用,则必须先对其进行修改以满足网络要求,然后再选择它作为新托管实例的目标。If a network or subnet is unavailable, it must be modified to satisfy the network requirements before you select it as a target for the new managed instance. 有关为托管实例配置网络环境所要满足的要求的信息,请参阅为托管实例配置虚拟网络For information about the requirements for configuring the network environment for a managed instance, see Configure a virtual network for a managed instance.
    连接类型Connection type 选择“代理”或“重定向”连接类型。Choose between a proxy and a redirect connection type. 有关连接类型的详细信息,请参阅 Azure SQL 数据库连接策略For more information about connection types, see Azure SQL Database connection policy.
    公共终结点Public endpoint 选择“启用” 。Select Enable. 若要通过公共数据终结点访问托管实例,需启用此选项。For a managed instance to be accessible through the public data endpoint, you need to enable this option.
    允许的访问来源(如果启用了“公共终结点” )Allow access from (if Public endpoint is enabled) 选择一个选项。Select one of the options. 在门户体验中可以使用公共终结点配置安全组。The portal experience enables configuring a security group with a public endpoint.

    根据具体的方案选择以下选项之一:Based on your scenario, select one of the following options:
    • Azure 服务:从 Power BI 或另一多租户服务进行连接时,建议使用此选项。Azure services: We recommend this option when you're connecting from Power BI or another multitenant service.
    • Internet:用于测试,可让你快速运转托管实例。Internet: Use for test purposes when you want to quickly spin up a managed instance. 建议不要将它用于生产环境。We don't recommend it for production environments.
    • 不允许访问:此选项创建一个“拒绝”安全规则。 No access: This option creates a Deny security rule. 修改此规则才能通过公共终结点访问托管实例。Modify this rule to make a managed instance accessible through a public endpoint.

    有关公共终结点安全性的详细信息,请参阅通过公共终结点安全地使用 Azure SQL 数据库托管实例For more information on public endpoint security, see Using an Azure SQL Database managed instance securely with a public endpoint.
  • 选择“查看 + 创建”,在创建托管实例之前查看所做的选择。 Select Review + create to review your choices before you create a managed instance. 也可配置更多自定义设置,方法是选择“下一步: 其他设置”。Or, configure more custom settings by selecting Next: Additional settings.

其他设置Additional settings

  • 填写“附加设置”选项卡中的可选信息。 如果省略此信息,门户会应用默认设置。Fill out optional information on the Additional settings tab. If you omit this information, the portal will apply default settings.

    用于创建托管实例的“其他设置”选项卡

    参考下表来填写此选项卡中的所需信息。Use the table below as a reference for information required at this tab.

    设置Setting 建议的值Suggested value 说明Description
    排序规则Collation 选择需要用于托管实例的排序规则。Choose the collation that you want to use for your managed instance. 如果从 SQL Server 迁移数据库,请使用 SELECT SERVERPROPERTY(N'Collation') 检查源排序规则并使用该值。If you migrate databases from SQL Server, check the source collation by using SELECT SERVERPROPERTY(N'Collation') and use that value. 有关排序规则的信息,请参阅设置或更改服务器排序规则For information about collations, see Set or change the server collation.
    时区Time zone 选择要求托管实例遵循的时区。Select the time zone that your managed instance will observe. 有关详细信息,请参阅时区For more information, see Time zones.
    用作故障转移辅助托管实例Use as failover secondary 请选择“是”。 Select Yes. 启用此选项即可将托管实例用作故障转移组辅助托管实例。Enable this option to use the managed instance as a failover group secondary.
    主托管实例(如果“用作故障转移辅助托管实例”设置为“是”) Primary managed instance (if Use as failover secondary is set to Yes) 选择一个现有的主托管实例,该实例会加入你要创建的托管实例所在的 DNS 区域。Choose an existing primary managed instance that will be joined in the same DNS zone with the managed instance you're creating. 此步骤会启用对故障转移组进行创建后配置的功能。This step will enable post-creation configuration of the failover group. 有关详细信息,请参阅教程:将 SQL 数据库托管实例添加到故障转移组For more information, see Tutorial: Add a SQL Database managed instance to a failover group.

查看 + 创建Review + create

  1. 选择“查看 + 创建”选项卡,在创建托管实例之前查看所做的选择。 Select Review + create tab to review your choices before you create the managed instance.

    用于查看和创建托管实例的选项卡

  2. 选择“创建” ,开始预配托管实例。Select Create to start provisioning the managed instance.

Important

部署托管实例是一项运行时间很长的操作。Deploying a managed instance is a long-running operation. 通常情况下,子网中第一个实例的部署时间比子网中已经有托管实例时实例的部署时间要长得多。Deployment of the first instance in the subnet typically takes much longer than deploying into a subnet with existing managed instances. 若要了解平均预配时间,请参阅托管实例管理操作For average provisioning times, see Managed instance management operations.

监视部署进度Monitor deployment progress

  1. 选择“通知”图标以查看部署状态。 Select the Notifications icon to view the status of the deployment.

    进行托管实例部署时的部署进度

  2. 在通知中选择“正在进行的部署”以打开托管实例窗口,进一步监视部署进度 。Select Deployment in progress in the notification to open the managed instance window and further monitor the deployment progress.

Tip

如果关闭了 Web 浏览器或离开了部署进度屏幕,可遵循以下步骤返回到部署进度屏幕:If you closed your web browser or moved away from the deployment progress screen, follow these steps to locate back the deployment progress screen:

  1. 在 Azure 门户中,打开要向其部署托管实例的资源组(位于“基本信息”选项卡上)。 In Azure portal, open the resource group (on the Basics tab) to which you're deploying a managed instance.
  2. 选择“部署”。 Select Deployments.
  3. 选择正在进行的托管实例部署操作。Select the managed instance deployment operation in progress.

Important

若要获取托管实例创建状态,需要有资源组的读取权限In order to be able to get the status of managed instance creation, you need to have read permissions over the resource group. 如果没有此权限,或者在托管实例创建过程中将其撤消,则可能会导致托管实例在资源组部署列表中不可见。If you don't have this permission or revoke it while managed instance is in creation process, this can cause managed instance not to be visible in list of resource group deployments.

部署后的操作Post-deployment operations

若要查看创建的资源、微调网络设置以及检索主机连接详细信息 (FQDN),请遵循本部分所述的步骤。To review resources created, fine-tune network settings, and retrieve host connection details (FQDN) follow steps described in this section.

查看创建的资源View resources created

成功部署托管实例后,若要查看创建的资源:Upon successful deployment of managed instance, to view resources created:

  1. 打开托管实例的资源组。Open the resource group for your managed instance. 创建托管实例快速入门中查看其资源(为你创建)。View its resources that were created for you in the Create a managed instance quickstart.

    托管实例资源

查看和微调网络设置View and fine-tune network settings

若要选择性地微调网络设置,请检查以下各项:To optionally fine-tune networking settings, inspect the following:

  1. 选择路由表,查看为你创建的用户定义的路由 (UDR)。Select the route table to review the user-defined route (UDR) that was created for you.

    路由表

  2. 在路由表中,查看用于通过托管实例的虚拟网络路由流量的条目。In the route table, review the entries to route traffic from and within the managed instance's virtual network. 若要手动创建或配置路由表,请务必在托管实例路由表中创建这些条目。If you create or configure your route table manually, ensure to create these entries in the managed instance route table.

    本地托管实例子网的条目

  3. 返回到资源组并选择网络安全组。Return to the resource group, and select the network security group.

    网络安全组

  4. 查看入站和出站安全规则。Review the inbound and outbound security rules.

    安全规则

Important

如果为托管实例配置了公共终结点,则需要打开端口以允许网络流量从公共 Internet 连接到托管实例,有关详细信息,请参阅为托管实例配置公共终结点If you have configured public endpoint for your managed instance, you need to open ports to allow network traffic allowing connections to managed instance from the public Internet, see Configure a public endpoint for managed instance for more information.

检索托管实例的连接详细信息Retrieve connection details to managed instance

若要连接到托管实例,请遵循以下步骤检索主机名和完全限定的域名 (FQDN):To connect to managed instance, follow these steps to retrieve host name and fully qualified domain name (FQDN):

  1. 返回资源组并选择托管实例。Return to the resource group and select your managed instance.

    资源组中的托管实例

  2. 在“概述”选项卡上,找到“主机”属性。 On the Overview tab, locate the Host property. 复制托管实例的主机名,该名称可在下一个快速入门中使用。Copy the host name for the managed instance for use in the next quickstart.

    主机名

    复制的值表示可用于连接到托管实例的完全限定域名 (FQDN)。The value copied represents a fully qualified domain name (FQDN) that can be used to connect to managed instance. FQDN 类似于以下地址示例:your_host_name.a1b2c3d4e5f6.database.chinacloudapi.cn 。It is similar to the following address example: your_host_name.a1b2c3d4e5f6.database.chinacloudapi.cn.

后续步骤Next steps

若要了解如何连接到托管实例:To learn about how to connect to a managed instance:

若要将现有 SQL Server 数据库从本地还原到托管实例:To restore an existing SQL Server database from on-premises to a managed instance: