[SQL in Azure] Provisioning a SQL Server Virtual Machine on Azure

http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-provision-sql-server/

Provisioning a SQL Server Virtual Machine on Azure

The Azure virtual machine gallery includes several images that contain Microsoft SQL Server. You can select one of the virtual machine images from the gallery and with a few clicks you can provision the virtual machine to your Azure environment.

In this tutorial, you will:

Connect to the Azure management portal and provision a virtual machine from the gallery

  1. Log in to the Azure Management Portal using your account. If you do not have an Azure account, visit Azure free trial.
  2. On the Azure Management Portal, at the bottom left of the web page, click +NEW, click COMPUTE, click VIRTUAL MACHINE, and then click FROM GALLERY.
  3. On the Create a Virtual Machine page, select a virtual machine image containing SQL Server, and then click the next arrow at the bottom right of the page. For the most up-to-date information on the supported SQL Server images on Azure, see Getting Started with SQL Server in Azure Virtual Machines topic in the SQL Server in Azure Virtual Machines documentation set.
    NOTE:

    If you have a virtual machine created by using the platform image SQL Server Evaluation edition, you cannot upgrade it to a per-minute paid edition image in the gallery. You can choose one of the following two options:

  4. On the Virtual Machine Configuration page, provide the following information:
    • Provide a VIRTUAL MACHINE NAME.
    • In the NEW USER NAME box, type unique user name for the VM local administrator account.
    • In the NEW PASSWORD box, type a strong password. For more information, see Strong Passwords.
    • In the CONFIRM PASSWORD box, retype the password.
    • Select the appropriate SIZE from the drop down list.
    NOTE:

    The size of the virtual machine is specified during provisioning: A2 is the smallest size recommended for production workloads. The minimum recommended size for a virtual machine is A3 when using SQL Server Enterprise Edition. Select A3 or higher when using SQL Server Enterprise Edition. Select A6 when using SQL Server 2012 Enterprise for Data Warehousing image. Select A7 when using SQL Server 2014 for Data Warehousing image. The size selected limits the number of data disks you can configure. For most up-to-date information on available virtual machine sizes and the number of data disks that you can attach to a virtual machine, see Virtual Machine Sizes for Azure.

    Click the next arrow on the bottom right to continue.

  5. On the Virtual machine mode page, provide the following information:
    • Select Standalone Virtual Machine.
    • In the DNS NAME box, provide the first portion of a DNS name of your choice, so that it completes a name in the format TESTNAME.cloudapp.net
    • In the REGION/AFFINITY GROUP/VIRTUAL NETWORK box, select a region where this virtual image will be hosted.

    Click the next arrow to continue.

  6. On the Virtual machine options page:
    • In the AVAILABILITY SET box, select (none).
    • Read and accept the legal terms.

  7. Click the check mark in the bottom right corner to continue.
  8. Wait while Azure prepares your virtual machine. Expect the virtual machine status to proceed through:
    • Starting (Provisioning)
    • Stopped
    • Starting (Provisioning)
    • Running (Provisioning)
    • Running

Open the virtual machine using Remote Desktop and complete setup

  1. When provisioning completes, click on the name of your virtual machine to go to the DASHBOARD page. At the bottom of the page, click Connect.

  2. Choose to open the rpd file using the Windows Remote Desktop program (%windir%\system32\mstsc.exe).
  3. At the Windows Security dialog box, provide the password for the local administrator account that you specified in an earlier step. (You might be asked to verify the credentials of the virtual machine.)
  4. The first time you log on to this virtual machine, several processes may need to complete, including setup of your desktop, Windows updates, and completion of the Windows initial configuration tasks (sysprep). After Windows sysprep completes, SQL Server setup completes configuration tasks. These tasks make cause a short delay while they complete. SELECT @@SERVERNAME may not return the correct name until SQL Server setup completes.

Once you are connected to the virtual machine with Windows Remote Desktop, the virtual machine works much like any other computer. Connect to the default instance of SQL Server with SQL Server Management Studio (running on the virtual machine) in the normal way.

Complete Configuration steps to connect to the virtual machine Using SQL Server Management Studio on another computer

Before you can connect to the instance of SQL Server from the internet, you must complete the following tasks as described in the sections that follow:

The connection path is summarized by the following diagram:

Create a TCP endpoint for the virtual machine

The virtual machine must have an endpoint to listen for incoming TCP communication. This Azure configuration step, directs incoming TCP port traffic to a TCP port that is accessible to the virtual machine.

  1. On the Azure Management Portal, click on VIRTUAL MACHINES.
  2. Click on your newly created virtual machine. Information about your virtual machine is presented.
  3. Near the top of the page, select the ENDPOINTS page, and then at the bottom of the page, click ADD ENDPOINT.

  4. On the Add Endpoint to Virtual Machine page, click Add Endpoint, and then click the Next arrow to continue.

  5. On the Specify the details of the endpoint page, provide the following information.
    • In the NAME box, provide a name for the endpoint.
    • In the PROTOCOL box, select TCP. You may type SQL Server‘s default listening port 1433 in the Private Port box. Similarly, you may type 57500 in the PUBLIC PORT box. Note that many organizations select different port numbers to avoid malicious security attacks.

  6. Click the check mark to continue. The endpoint is created.

Open TCP ports in the Windows firewall for the default instance of the Database Engine

  1. Connect to the virtual machine via Windows Remote Desktop. Once logged in, on the Start menu, click Run, type WF.msc, and then click OK.

  2. In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane.

  3. In the Rule Type dialog box, select Port, and then click Next.
  4. In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the Database Engine (1433 for the default instance or your choice for the private port in the endpoint step).

  5. Click Next.
  6. In the Action dialog box, select Allow the connection, and then click Next.

    Security Note: Selecting Allow the connection if it is secure can provide additional security. Select this option if you want to configure additional security options in your environment.

  7. In the Profile dialog box, select Public, and then click Next.

    Security Note: Selecting Public allows access over the internet. Whenever possible, select a more restrictive profile.

  8. In the Name dialog box, type a name and description for this rule, and then click Finish.

Open additional ports for other components as needed. For more information, see Configuring the Windows Firewall to Allow SQL Server Access.

Configure SQL Server to listen on the TCP protocol

  1. While connected to the virtual machine by using Remote Desktop, on the Start menu, click All Programs, click Microsoft SQL Server version, click Configuration Tools, and then click SQL Server Configuration Manager.

  2. In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration.
  3. In the console pane, click Protocols for instance name. (The default instance is Protocols for MSSQLSERVER.)
  4. In the details pane, right-click TCP, it should be Enabled for the gallery images by default. For your custom images, click Enable (if its status is Disabled.)

  5. In the console pane, click SQL Server Services. (Restarting the Database Engine can be postponed until completion of the next step.)
  6. In the details pane, right-click SQL Server (instance name) (the default instance is SQL Server (MSSQLSERVER)), and then click Restart, to stop and restart the instance of SQL Server.

  7. Close SQL Server Configuration Manager.

For more information about enabling protocols for the SQL Server Database Engine, see Enable or Disable a Server Network Protocol.

Configure SQL Server for mixed mode authentication

The SQL Server Database Engine cannot use Windows Authentication without domain environment. To connect to the Database Engine from another computer, configure SQL Server for mixed mode authentication. Mixed mode authentication allows both SQL Server Authentication and Windows Authentication. (Configuring mixed mode authentication might not be necessary if you have configured an Azure Virtual Network. For more information, see Connectivity Considerations for SQL Server in Azure Virtual Machines topic in the SQL Server in Azure Virtual Machines documentation set.

  1. While connected to the virtual machine by using Remote Desktop, on the Start menu, click All Programs, click Microsoft SQL Server version, and then click SQL Server Management Studio.

    The first time you open Management Studio it must create the users Management Studio environment. This may take a few moments.

  2. When opening, Management Studio presents the Connect to Server dialog box. In the Server name box, type the name of the virtual machine to connect to the Database Engine with the Object Explorer. (Instead of the virtual machine name you can also use (local) or a single period as the Server name. Select Windows Authentication, and leave your_VM_name\your_local_administrator in the User name box. Click Connect.

  3. In SQL Server Management Studio Object Explorer, right-click the name of the instance of SQL Server (the virtual machine name), and then click Properties.

  4. On the Security page, under Server authentication, select SQL Server and Windows Authentication mode, and then click OK.

  5. In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.
  6. In Object Explorer, right-click your server, and then click Restart. (If SQL Server Agent is running, it must also be restarted.)

  7. In the SQL Server Management Studio dialog box, click Yes to agree that you want to restart SQL Server.

Create SQL Server authentication logins

To connect to the Database Engine from another computer, you must create at least one SQL Server authentication login.

  1. In SQL Server Management Studio Object Explorer, expand the folder of the server instance in which you want to create the new login.
  2. Right-click the Security folder, point to New, and select Login....

  3. In the Login - New dialog box, on the General page, enter the name of the new user in the Login name box.
  4. Select SQL Server authentication.
  5. In the Password box, enter a password for the new user. Enter that password again into the Confirm Password box.
  6. To enforce password policy options for complexity and enforcement, select Enforce password policy (recommended). This is a default option when SQL Server authentication is selected.
  7. To enforce password policy options for expiration, select Enforce password expiration (recommended). Enforce password policy must be selected to enable this checkbox. This is a default option when SQL Server authentication is selected.
  8. To force the user to create a new password after the first time the login is used, select User must change password at next login (Recommended if this login is for someone else to use. If the login is for your own use, do not select this option.) Enforce password expiration must be selected to enable this checkbox. This is a default option when SQL Server authentication is selected.
  9. From the Default database list, select a default database for the login. master is the default for this option. If you have not yet created a user database, leave this set to master.
  10. In the Default language list, leave default as the value.

  11. If this is the first login you are creating, you may want to designate this login as a SQL Server administrator. If so, on the Server Roles page, check sysadmin.

    Security Note: Members of the sysadmin fixed server role have complete control of the Database Engine. You should carefully restrict membership in this role.

  12. Click OK.

For more information about SQL Server logins, see Create a Login.

Determine the DNS name of the virtual machine

To connect to the SQL Server Database Engine from another computer, you must know the Domain Name System (DNS) name of the virtual machine. (This is the name the internet uses to identify the virtual machine. You can use the IP address, but the IP address might change when Azure moves resources for redundancy or maintenance. The DNS name will be stable because it can be redirected to a new IP address.)

  1. In the Azure Management Portal (or from the previous step), select VIRTUAL MACHINES.
  2. On the VIRTUAL MACHINE INSTANCES page, in the DNS NAME column, find and copy the DNS name for the virtual machine which appears preceded by http://. (The user interface might not display the entire name, but you can right-click on it, and select copy.)

Connect to the Database Engine from another computer

  1. On a computer connected to the internet, open SQL Server Management Studio.
  2. In the Connect to Server or Connect to Database Engine dialog box, in the Server name box, enter the DNS name of the virtual machine (determined in the previous task) and a public endpoint port number in the format of DNSName,portnumber such as tutorialtestVM.cloudapp.net,57500.
  3. In the Authentication box, select SQL Server Authentication.
  4. In the Login box, type the name of a login that you created in an earlier task.
  5. In the Password box, type the password of the login that you create in an earlier task.
  6. Click Connect.

Connecting to the Database Engine from your application

If you can connect to an instance of SQL Server running on an Azure virtual machine by using Management Studio, you should be able to connect by using a connection string similar to the following.

connectionString="Server=<DNS_Name>;Integrated Security=false;User ID=<login_name>;Password=<your_password>;"providerName="System.Data.SqlClient"

For more information, see How to Troubleshoot Connecting to the SQL Server Database Engine.

Next Steps

You‘ve seen how to create and configure a SQL Server on an Azure virtual machine using the platform image. When using SQL Server in Azure Virtual Machines, we recommend that you follow the detailed guidance given in the SQL Server in Azure Virtual Machines documentation in the library. This documentation set includes a series of articles and tutorials that provide detailed guidance. The series includes the following sections:

SQL Server in Azure Virtual Machines

Getting Started with SQL Server in Azure Virtual Machines

Getting Ready to Migrate to SQL Server in Azure Virtual Machines

  • How to migrate SQL Server database files and schema between virtual machines in Azure using data disks

SQL Server Deployment in Azure Virtual Machines

  • How to copy SQL Server data and setup files in a data disk from on-premises to Azure using CSUpload
  • How to create a base virtual machine on-premises using Hyper-V
  • How to create a SQL Server virtual machine in Azure using the existing on-premises SQL Server disk
  • How to create a SQL Server virtual machine in Azure using the existing on-premises SQL Server virtual machine
  • How to use PowerShell to set up a SQL Server virtual machine in Azure
  • How to Use Attached Data Disk to Store Database Files

Connectivity Considerations for SQL Server in Azure Virtual Machines

  • Tutorial: Connect to SQL Server in the same cloud service
  • Tutorial: Connect to SQL Server in a different cloud service
  • Tutorial: Connect ASP.NET application to SQL Server in Azure via Virtual Network

Performance Considerations for SQL Server in Azure Virtual Machines

Security Considerations for SQL Server in Azure Virtual Machines

Troubleshooting and Monitoring for SQL Server in Azure Virtual Machines

High Availability and Disaster Recovery for SQL Server in Azure Virtual Machines

  • Tutorial: AlwaysOn Availability Groups in Azure (GUI)
  • Tutorial: AlwaysOn Availability Groups in Azure (PowerShell)
  • Tutorial: AlwaysOn Availability Groups in Hybrid IT (PowerShell)
  • Tutorial: Listener Configuration for AlwaysOn Availability Groups in Azure
  • Tutorial: Listener Configuration for AlwaysOn Availability Groups in HybridIT
  • Tutorial: Database Mirroring for Disaster Recovery in Azure
  • Tutorial: Database Mirroring for Disaster Recovery in Hybrid IT
  • Tutorial: Database Mirroring for High Availability in Azure
  • Tutorial: Log Shipping for Disaster Recovery in Hybrid IT
  • Troubleshooting Availability Group Listener in Azure

Backup and Restore for SQL Server in Azure Virtual Machines

SQL Server Business Intelligence in Azure Virtual Machines

  • Use PowerShell to Create an Azure VM With SQL Server BI and SharePoint 2010
  • Use PowerShell to Create an Azure VM With SQL Server BI and SharePoint 2013
  • Use PowerShell to Create an Azure VM With a Native Mode Report Server

SQL Server Data Warehousing in Azure Virtual Machines

Technical Articles for SQL Server in Azure Virtual Machines

[SQL in Azure] Provisioning a SQL Server Virtual Machine on Azure

时间: 2024-10-17 10:51:32

[SQL in Azure] Provisioning a SQL Server Virtual Machine on Azure的相关文章

Windows Azure Virtual Machine (24) Azure VM支持多网卡功能

<Windows Azure Platform 系列文章目录> Windows Azure VM在默认情况下,是一张网卡,2个IP地址.在很多情况下,我们需要Azure支持多张网卡,在这里笔者简单介绍一下. 假设我们创建了一个虚拟网络,3个Subnet子网,分为命名为Frondend, MidTier和Backend,具有不同的CIDR地址.如下图: 那我们可以创建一个具有三个网卡的Azure VM,每张网卡对应不同的subnet.如下图: 这里特别强调一下,创建多网卡的Azure VM是有限

Azure PowerShell (6) 设置Virtual Machine Endpoint

<Windows Azure Platform 系列文章目录> 请注意: - Azure不支持增加Endpoint Range - 最多可以增加Endpoint数量为150 http://azure.microsoft.com/zh-cn/documentation/articles/azure-subscription-service-limits/ 我们可以通过Windows Azure Management Portal,打开Virtual Machine的Endpoint,借用我之前博

sql server 导出数据到 Azure Hbase / Hive 详细步骤

The Hadoop on Azure Sqoop Import Sample Tutorial Table of Contents Overview Goals Key technologies Setup and Configuration Tutorial How to set up a SQL database How to use Sqoop from Hadoop on Azure to import SQL Database query results to the HDFS cl

通过本地的SQL Manage sutudio管理windows azure上的SQL Server

通过SQL Manage sutudio管理windows azure上的SQL Server 说到windows azure上的SQL创建,我们在上一篇文章上有介绍了,那今天主要介绍什么呢,我们发现在windows azure上创建的sql数据库下没有SQL Server代理选项功能.我相信大家都用过SQL Server代理相关的功能,具体功能就不用多说了.拿我来说,因为我们有个服务的数据是写入到SQL Server上的,我们在本地通过计划人物实现对数据保留60天,然后通过web方式查询,这样

通过SSMS工具迁移本地的SQL Server Database到Windows Azure SQL Database

微软的产品更新越来越快了,几乎每年都有产品更新,今天呢,我们主要介绍一下,如何将本地的SQL Server数据库迁移到windows azure上的SQL Server Database.当然说到SQL Serrver数据库的迁移,大家都会想到最普通及最普遍的方法,那就是通过备份数据库,然后通过备份的数据库文件进行还原.其实呢,我们在IT运维的工作中多少会有体会,最普通的方法往往是最有效的方法也是最安全的方法,但是效率不高,由于时代进步的太快了,我们也不能太out了,也不想用这个古老的方法去做数

Azure 文档 (SQL 数据仓库, Azure SQL 数据库文档)

Azure 文档: https://docs.azure.cn/zh-cn/#pivot=products&panel=databases SQL 数据仓库文档:https://docs.azure.cn/zh-cn/sql-data-warehouse/ 了解如何使用 SQL 数据仓库,其结合了 SQL Server 关系数据库与大规模并行处理. 教程和其他文档介绍了如何将数据加载到数据仓库,并分析.管理和导出数据. Azure SQL 数据库文档: https://docs.azure.cn

SQL安装过程中“针对SQL Server 注册表的一致性验证“出错解决方式

1.打开注册表,查找到[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\0804],分别打开Counter 和Help 2.打开Counter,把滚动条拉倒最后,然后记下最大的那个值(不同计算机不一样的),记下后关闭窗口 3.同样的打开Help,滚动到最后记最大的那个值(你们的值不一定跟我一样的哦!!!),记下后关闭窗口 4,再重新定位到Perflib的节点上, 5.双击Last Counter然后在

打开较大存储量的.sql文件时,出现SQL Server 阻止了对组件 &#39;xp_cmdshell&#39; 的 过程&#39;sys.xp_cmdshell&#39; 的访问

1. “消息 15281,级别 16,状态 1,过程 xp_cmdshell,第 1 行SQL Server 阻止了对组件 'xp_cmdshell' 的 过程'sys.xp_cmdshell' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭.系统管理员可以通过使用 sp_configure 启用 'xp_cmdshell'.有关启用 'xp_cmdshell' 的详细信息,请参阅 SQL Server 联机丛书中的 "外围应用配置器". ” 解决方法: sqlserver2

sql连接错误(Microsoft SQL Server,错误:2)

昨天用SQL语句建表的时候写了一段代码,对于代码的逻辑和内容我不太肯定对不对,反正是毫不犹豫的让它执行了,过程中出现好几个错误,当时没有太在意,想着大不了出错了再重写一个,结果--玩坏了,从昨天到现在十几个小时,SQL Server毫无商量的给我罢工了!于是乎,漫长的"寻错"之路开始了. 先看下出错信息: 1.通过以往经验我先打开了SQL Server配置工具-->配置管理器,检查里边的协议是否开启,就在这时我又犯了一个错误.因为不知道那些协议到底是什么意思,索性干脆都启用了,结