azure批量创建虚拟机

In one of my articles about Microsoft Azure, I show how to create credentials and how to connect to an Azure Database using SQL Server Management Studio (SSMS). In this new article, we will talk about the Azure Virtual Machines and we will learn how to connect to them using our local SSMS. You will require unblocking ports, add endpoints and other tasks that I will explain later. We will also learn how to export a local database to an Azure Virtual Machine with SQL Server installed.

在我的有关Microsoft Azure的文章中 ,我展示了如何创建凭据以及如何使用SQL Server Management Studio(SSMS)连接到Azure数据库。 在这篇新文章中,我们将讨论Azure虚拟机,并将学习如何使用本地SSMS连接到它们。 您将需要取消阻塞端口,添加端点和其他任务,我将在后面解释。 我们还将学习如何将本地数据库导出到安装了SQL Server的Azure虚拟机。

要求 ( Requirements )

In this example, we will require an Azure Virtual Machine installed, a local machine with SQL Server and SSMS installed, the Cloud Adapter (we are including the steps to configure it) and a certificate which will also be explained in this section.

在此示例中,我们将需要安装Azure虚拟机,安装了SQL Server和SSMS的本地计算机,云适配器(我们包括配置它的步骤)和证书,本节还将对此进行说明。

  1. this link. To create a virtual machine, review 此链接 。 要创建虚拟机,请查看this link.此链接 。
  2. A local machine with the SQL Server Engine Installed and a database to export with access to internet.

    安装了SQL Server引擎的本地计算机和要访问Internet的要导出的数据库。

    The Cloud Adapter

    云适配器

    1. A Cloud Adapter. The cloud adapter is an Azure Service required for SQL Server and generates a SSL certificate In the Azure portal. In order to create it, go to Virtual Machines and click on the virtual machine name.

      云适配器。 云适配器是SQL Server必需的Azure服务,并在Azure门户中生成SSL证书。 为了创建它,请去虚拟机并且点击虚拟机名称。

      Figure r1. The Azure virtual machines.

      图r1。 Azure虚拟机。

    2. Click on EndPoints.

      单击端点。

      Figure r2. The Endpoints

      图r2。 终点

    3. Figure r3. Add new endpoints

      图r3。 添加新端点

    4. Add the Endpoint name, protocol and port (by default it is the port 11435).

      添加端点名称,协议和端口(默认情况下为端口11435)。

      Figure r4. The cloud Adapter for SQL

      图r4。 适用于SQL的云适配器

    A certificate

    证书

    Another requirement is a certificate to connect to the Cloud. In order to do it do the following steps:

    另一个要求是连接到云的证书。 为此,请执行以下步骤:

    1. Open the certmgr.msc. You can create your certificate or use an existing one. In this example we will use an existing one.

      打开certmgr.msc。 您可以创建证书或使用现有证书 。 在此示例中,我们将使用现有示例。

      R5. The certificate console

      R5。 证书控制台

    2. Select the certificate right click and select All Tasks>Export

      R6. Export a certificate

    3. 右键单击证书,然后选择“所有任务”>“导出”

      R6。 导出证书

    4. The wizard to export certificates will be displayed. Click next.

      将显示导出证书的向导。 点击下一步。

      R7. Export Wizard.

      R7。 导出向导。

    5. Select if you want to have a private key.

      选择是否要使用私钥。

      R8. Private key question

      R8。 私人 关键 问题

    6. Specify the format of the certificate.

      指定证书的格式。

      R9. Select the certify format

      R9。 选择认证格式

    7. Specify a name and a path.

      指定名称和路径。

      R10. Selecting name and path of the .cer file.

      R10。 选择名称和路径 cer 文件。

    8. Once the Wizard is completed, press finish.

      向导完成后,按完成。

      R11. Final step of the export wizard.

      R11。 导出向导的最后一步。

    9. Go to the Azure portal and click on the Virtual Machine.

      转到Azure门户,然后单击“虚拟机”。

      R12. The virtual machine.

      R12。 虚拟机。

    10. Click on the Management Certificates link.

      单击管理证书链接。

      R13. The certificates

      R13。 证书

    11. Click the Upload button and upload the certificate created on step 7.

      单击上载按钮,然后上载在步骤7中创建的证书。

      R14. The option to upload certificates.

      R14。 上传证书的选项。

    12. 入门 ( Getting Started )

      1. To connect to a Virtual Machine, you can use the SQL Server Account. In order to enable the SQL Server authentication, in the Azure Virtual Machine (VM), open the SSMS and connect to the database. Right click on your Server and select properties. Change the Server Authentication to SQL Server and Windows Authentication to connect from your local machine.

        要连接到虚拟机,您可以使用SQL Server帐户。 为了启用SQL Server身份验证,请在Azure虚拟机(VM)中,打开SSMS并连接到数据库。 右键单击服务器,然后选择属性。 将服务器身份验证更改为SQL Server和Windows身份验证以从本地计算机连接。

        Figure 1. Server properties

        图1. 服务器属性

      2. You will be prompted a message about restarting the SQL Server Service.

        系统将提示您有关重新启动SQL Server服务的消息。

        Figure 2. Information message.

        图2. 信息消息。

      3. Restart the Service in order for the new configuration to take effect.

        重新启动服务,以使新配置生效。

        Figure 3. Restarting the MSSQL Service

        图3.重新启动MSSQL服务

      4. Now that the SQL Server authentication is enabled, create a SQL Server Login.

        现在已启用SQL Server身份验证,请创建一个SQL Server登录名。

        Figure 4. Creating a new login.

        图4.创建一个新的登录名。

      5. Specify the login name and passwords. It is recommended to enforce the password policy for security reasons. In this example, we will omit the Enforce password policy to simplify the example.

        指定登录名和密码。 出于安全原因,建议强制执行密码策略。 在此示例中,我们将省略“强制密码”策略以简化示例。

        Figure 5. Login settings

        图5.登录设置

      6. Go to the Virtual Machine in the Azure Portal and click on the Virtual Machine name.

        转到Azure门户中的虚拟机,然后单击虚拟机名称。

        Figure 6. The virtual machine status

        图6.虚拟机状态

      7. Click the ENDPOINTS link and press the Add icon to add a new Endpoint.

        单击ENDPOINTS链接,然后按添加图标以添加新的端点。

        Figure 7. Endpoints

        图7.端点

      8. Select the add Standalone Endpoint

        选择添加独立端点

        Figure 8. Adding endpoint

        图8. 添加端点

      9. Write the name of the Endpoint. The protocol should be TCP and the port by default in the default instance is 1433.

        输入端点的名称。 该协议应为TCP,默认实例中的默认端口为1433。

        Figure 9. Endpoint settings

        图9.端点设置

      10. The ACL allows you to specify the range of subnets allowed to access to your Azure virtual Machine. You can provide the name and subnet. If you do not your Internet IP, you can use this link.

        ACL允许您指定允许访问Azure虚拟机的子网范围。 您可以提供名称和子网。 如果您没有Internet IP,则可以使用此链接 。

        Figure 10. The ACL details

        图10. ACL详细信息

      11. You also need to enable the ports used to access remotely. Go to the Windows Firewall and right click on the Inbound Rules and select new rule.

        您还需要启用用于远程访问的端口。 转到Windows防火墙,然后右键单击“入站规则”,然后选择新规则。

        Figure 11. The Inbound rules.

        图11.入站规则。

      12. Specify the port to which you want to apply a rule. In this case, it is the port 1433.

        指定要对其应用规则的端口。 在这种情况下,它是端口1433。

        Figure 12. The TCP IP SQL Server port

        图12. TCP IP SQL Server端口

      13. In the action, select the allow the connection option.

        在操作中,选择“允许连接”选项。

        Figure 13. Allow permissions

        图13. 允许权限

      14. Select the rule that you want to apply.

        选择您要应用的规则。

        Figure 14. Rules to apply

        图14. 适用规则

      15. Write a name for the rule.

        为规则写一个名字。

        Figure 15. Rule name

        图15.规则名称

      16. Now connect to your Azure VM from the SSMS of the local machine.

        现在,从本地计算机的SSMS连接到您的Azure VM。

        Figure 16. 图16. Connect to an Azure VM from the local SSMS 从本地SSMS连接到Azure VM

        If everything is OK you can now connect to the SQL Server machine with Azure from your local machine.

        如果一切正常,您现在可以从本地计算机使用Azure连接到SQL Server计算机。

      如何使用将数据库部署到Windows Azure VM来部署数据库 ( How to deploy your database using the Deploy Database to Windows Azure VM )

      Now we will export our local database to the Azure Vm.

      现在,我们将本地数据库导出到Azure Vm。

      1. In the local SSMS, Select the database that you want to copy and select Tasks>Deploy Database to Windows Azure.

        在本地SSMS中,选择要复制的数据库,然后选择“任务”>“将数据库部署到Windows Azure”。

        Figure 17. The Deploy Database to Azure VM Wizard.

        图17.将数据库部署到Azure VM向导。

      2. The Introduction Wizard Windows will be displayed.

        将显示“简介向导”窗口。

        Figure 18. The Introduction Wizard.

        图18.简介向导。

      3. Press the Connect button to connect to the local SQL Server.

        按“连接”按钮连接到本地SQL Server。

        Figure 19. The local machine information

        图19. 本地机器信息

      4. Specify the Server name and credentials and press Connect.

        指定服务器名称和凭据,然后按连接。

        Figure 20. The local machine credentials.

        图20.本地计算机凭据。

      5. Select a database to export and a temporary location for the backup files. Make sure that the SQL Server has permissions on a temporary location.

        选择要导出的数据库和备份文件的临时位置。 确保SQL Server对临时位置具有权限。

        Figure 21. The Database to export and the temporary file. 图21.要导出的数据库和临时文件。

      6. To connect to Azure, you will need a Certificate. You can also work with a publishing profile. For more information about a publishing profile.

        若要连接到Azure,您将需要一个证书。 您也可以使用发布配置文件。 有关发布配置文件的更多信息。

        Figure 22. Certificate.

        图22 证书。

      7. Press the Select button and select the certificate created on the requirements section of this article. Copy the subscription ID of step 9 of the requirements in the certificate section.

        按“选择”按钮,然后选择在本文的“需求”部分上创建的证书。 在证书部分中复制需求的步骤9的订阅ID。

        Figure 23. The subscription ID.

        图23.订阅ID。

      8. Specify the Cloud Service name, Virtual Machine name and Storage Account and then press Settings.

        指定云服务名称,虚拟机名称和存储帐户,然后按设置。

        Figure 24. The subscription ID.

        图2 4 订阅ID。

      9. Specify the Virtual Machine, your credentials and the Cloud Adapter port. Verify in the requirements the port used. By default, it is the port 11435.

        指定虚拟机,您的凭据和云适配器端口。 在要求中验证使用的端口。 默认情况下,它是端口11435。

        Figure 25. Cloud Adapter information.

        图25.云适配器信息。

      10. You will receive a message about the certificate. If you agree, press Trust Publisher and connect.

        您将收到有关证书的消息。 如果您同意,请按Trust Publisher并进行连接。

        Figure 26. The Trust message.

        图26.信任消息。

      11. Finally you will have your information like this:

        最后,您将获得如下信息:

        Figure 27. The Azure VM information and the Local SQL Server information

        图27. Azure VM信息和本地SQL Server信息

      12. If everything is OK, the summary window will be displayed.

        如果一切正常,将显示“摘要”窗口。

        Figure 28. Summary Window

        图28.摘要窗口

      13. Finally, you will receive the results windows that will be green if everything is OK.

        最后,如果一切正常,您将收到绿色的结果窗口。

        Figure 29. The Results wizard. 图29.结果向导。

      14. To verify that the database was copied successfully, go to the virtual machine and verify that the database was copied successfully.

        要验证数据库是否已成功复制,请转到虚拟机并验证数据库是否已成功复制。

      结论 ( Conclusion )

      In this tutorial, we’ve learned how to connect to an Azure virtual machine with SQL Server using our local SQL Server. We also learned how to export a local database to a SQL Server Azure VM.

      在本教程中,我们学习了如何使用本地SQL Server通过SQL Server连接到Azure虚拟机。 我们还学习了如何将本地数据库导出到SQL Server Azure VM。

翻译自: https://www.sqlshack.com/migrate-your-database-to-an-azure-virtual-machine/

azure批量创建虚拟机

azure批量创建虚拟机_如何将数据库迁移到Azure虚拟机相关推荐

  1. sql azure 语法_如何将内部SQL Server数据库迁移到Azure

    sql azure 语法 Lately, database administrators often hear the question "have you tried Azure?&quo ...

  2. 数据库创建函数_达梦数据库创建UUID函数

    数据库创建函数_达梦数据库创建UUID函数 接触达梦数据库有一段时间了,整理了一些资料,今天分享一下达梦数据UUID自定义函数 UUID函数定义 很多数据库都有提供UUID函数,可是接触达梦数据库后, ...

  3. 使用SQL Server事务复制将SQL Server数据库迁移到Azure SQL数据库

    In this guide, we'll discuss more about migrating a SQL Server database to Azure SQL Database using ...

  4. 将本地SQL Server数据库迁移到Azure SQL数据库

    In this article, we will discuss and understand a method to migrate an on-premises SQL Server databa ...

  5. python 批量创建线程_【Python】批量创建线程

    在<[Python]线程的创建.执行.互斥.同步.销毁>(点击打开链接)中介绍了Python中线程的使用,但是里面线程的创建,使用了很原始的方式,一行代码创建一条.其实,Python里是可 ...

  6. 如何将同一云服务下的虚拟机从经典部署模型迁移到 Azure Resource Manager

    适用场景 用户希望将特定云服务下的所有虚拟机从经典部署模型(以下简称:ASM)迁移到 Azure Resource Manager(以下简称:ARM). Note 如果云服务下使用 VNET 也希望将 ...

  7. db2 linux 导入数据_实现DB2数据库迁移之导入步骤在Linux下

    今天是要和大家一起讨论的是在Linux操作平台下正确实现DB2数据库迁移之导入的实际操作步骤,如果你对DB2数据库迁移之导入的实际操作步骤,心存好奇的话,以下的文章将会揭开它的神秘面纱. (1)解压 ...

  8. 安卓虚拟机_【安卓】手机中的虚拟机

    手机一秒生崽崽         提起虚拟机一般都会想到的VMware Workstation等运行在PC端的虚拟机软件,这一类软件是通过虚拟机我们可以在操作系统中虚拟出另一个操作系统,从而实现各种操作 ...

  9. 使用 Azure Site Recovery 将内部部署虚拟化工作负荷迁移至 Azure

    ABHISHEK A. HEMRAJANI 云 + Enterprise 项目经理 我们最近发布了微软的灾难恢复即服务 (DRaaS) 产品的预览版 - Azure SiteRecovery.此产 ...

最新文章

  1. 连接服务器_命令行连接FTP服务器
  2. 公司喜欢什么样的程序员?三个特点吸引HR!
  3. OpenCV 脸部跟踪(1)
  4. 2021暑假每日一题 【week4 完结】
  5. BZOJ3451 Normal 期望、点分治、NTT
  6. boost::mp11::mp_rename相关用法的测试程序
  7. 使用border-collapse:collapse;属性新建一个细线表格
  8. linux和windows双系统互拷文件乱码问题
  9. Go语言实现HashSet
  10. 高效管理ASP.NET的JavaScript库
  11. kafka to mysql_Flink实现Kafka到Mysql的Exactly-Once
  12. Python基础(2):控制结构
  13. Android Studio查看MD5
  14. java运行无法加载主类_java运行显示“找不到或无法加载主类”的解决办法(linux)...
  15. 成功解决win7不能重装ie9的问题(重整版)
  16. Maven-仓库概念,下载与配置
  17. [竞赛01]2021CCF BDCI新闻摘要自动生成Baseline-T5模型
  18. hyper-v 安装 openwrt x86 squashfs
  19. R语言并行计算spearman相关系数
  20. Linux兄弟连视频教程—B站评论区总结

热门文章

  1. asp 退出登录修改cookie能进入后台_某logCMS的代码审计:越权到后台getshell
  2. gz键盘增强小工具_干货推荐∣6个超有用的在线工具,日常必备
  3. 白话容器namespace
  4. VS2010上连接SQLite数据库
  5. YOLO算法的ZYNQ移植尝试(SDx方法、ARM部分)
  6. 追梦软件路,愿不忘初心
  7. ArrayQueue详解(待解决)
  8. nopcommerce 二次开发
  9. 为Eclipse安装主题插件
  10. 零基础带你学习MySQL—Select语句以及注意事项(十)