[SQL in Azure] Getting Started with SQL Server in Azure Virtual Machines
This topic provides guidelines on how to sign up for SQL Server on a Azure virtual machine and how to get started creating SQL Server databases in Microsoft public cloud environment.
With SQL Server in Azure Virtual Machines, you get the full benefits of infrastructure-as-a-service offering in Microsoft data centers. Therefore, you have the full-control of the virtual machines that run your SQL Server as well as your applications and databases in Azure. You can move your enterprise breadth applications in your own virtualization platform on-premises to Azure by leveraging SQL Server in Azure Virtual Machine instead of purchasing new hardware to run your increasing needs. When you need more hardware just for a specific time period or to do validation or testing of your new application, Azure Virtual Machines provide flexibility to match your needs. You can build hybrid applications by hosting SQL Server databases in Azure Virtual Machines. Therefore, you can make your databases available to both on-premises and cloud applications.
This topic includes the following subsections:
- Creating a SQL Server Virtual Machine in Azure
- Configuration of the platform provided SQL Server virtual machine images
- How to connect to the instance of SQL Server in a Azure Virtual Machine
- Additional instances of the database engine and the platform provided SQL Server image
- Create new logins and users
- Next steps
Creating a SQL Server Virtual Machine in Azure
To create a SQL Server virtual machine in Azure, you must first obtain a Azure Platform subscription. You can purchase a Azure subscription at Purchase Options. To try it free, visit Azure free trial. Then, you can either bring your own virtual machine to Azure or use a platform-provided image to create your virtual machine in Azure.
The tutorial Provision a SQL Server virtual machine on Azure demonstrates how to create a SQL Server virtual machine by using a platform-provided image.
Important: Once you create a SQL Server virtual machine in Windows Azure, you need to perform some additional tasks to be able to connect to it from other virtual machines in Windows Azure or from your on-premises computers or from the Internet. For detailed guidance, see Connectivity Considerations for SQL Server in Azure Virtual Machines.
If you want to bring your own virtual machine to Azure, see How to create a SQL Server virtual machine in Azure using the existing on-premises SQL Server disk and How to create a SQL Server virtual machine in Azure using the existing on-premises SQL Server virtual machine.
For more information on managing Azure subscriptions, see Managing Subscriptions. The Azure virtual machine gallery provides several virtual machine images, such as Windows or non-Windows images. For the most up-to-date list of supported virtual machine images, see Virtual Machine Sizes for Azure and Virtual Machines Pricing Details.
Configuration of the platform provided SQL Server virtual machine images
The Azure Virtual Machine gallery includes several images that contain Microsoft SQL Server. The software installed on the virtual machine images varies based on the version of the operating system and the version of SQL Server. The following table summarizes the SQL Server related images currently available in the Azure Virtual Machine gallery:
Operating system | SQL Server version | SQL Server edition |
---|---|---|
Windows Server 2008 R2 |
SQL Server 2008 R2 Service Pack 2 |
Enterprise, Standard, and Web |
Windows Server 2012 |
SQL Server 2012 Service Pack 1 |
Enterprise, Standard, Web, and Data Warehouse (Enterprise) |
Windows Server 2012 R2 |
SQL Server 2014 and SQL Server 2014 for Data Warehousing |
Enterprise, Standard, Web, and Data Warehouse (Enterprise) |
Important note: Additional SQL Server versions and editions are being planned. Log in to the Azure Management Portal to see all the supported SQL Server versions and editions.
If you have a virtual machine created by using the platform image SQL Server Evaluation edition that was available during the Preview period, you cannot upgrade it to a per-hour paid edition image in the gallery. You can choose one of the following two options:
- You can create a new virtual machine by using the per-minute paid SQL Server edition from the gallery and migrate your database files to this new virtual machine by following the steps at How to migrate SQL Server database files and schema between virtual machines in Azure using data disks. Or,
- You can upgrade an existing instance of SQL Server Evaluation edition to a different edition of SQL Server under the License Mobility through Software Assurance on Azure agreement by following the steps at Upgrade to a Different Edition of SQL Server 2014. For information on how to purchase the licensed copy of SQL Server, see How to Buy SQL Server.
Windows Server
The Windows Server installation in the platform image contains the following configurations settings and components:
- Remote Desktop is enabled for the administrator account.
- Windows Update is enabled.
- By default, the user account specified during provisioning is a member of the local Administrators group. This administrator account is also the member of the SQL Server sysadmin server role.
- The virtual machine is a member of a workgroup named WORKGROUP.
- The Guest account is not enabled.
- Windows Firewall with Advanced Security (c:\Windows\System32\WF.msc) is turned on.
- .NET Framework version 4 is installed.
- The size of the virtual machine is specified during provisioning.
- Medium is the smallest size recommended for normal workloads.
- The minimum recommended size for a virtual machine is Large when using SQL Server Enterprise Edition.
- 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.
SQL Server
The SQL Server installation in the platform image contains the following configurations settings and components:
- Database Engine
- Analysis Services
- Integration Services
- Reporting Services (configured in Native mode)
- AlwaysOn Availability Groups are available in SQL Server 2012 (or later) but need additional configuration before they can be used. For more information, see High Availability and Disaster Recovery for SQL Server in Azure Virtual Machines.
- Replication
- Full-Text and Semantic Extractions for Search (Semantic Extractions in SQL Server 2012 or later only)
- Data Quality Services (SQL Server 2012 or later only)
- Master Data Services (SQL Server 2012 or later only), but requires additional configuration and components. To run Master Data Services in a virtual machine in Azure, install the Web Server (Internet Information Services) and Silverlight, and also configure Master Data Services by using Master Data Services Configuration Tool (MDSConfigTool.exe). For more information, see Install Master Data Services.
- PowerPivot for SharePoint is available (SQL Server 2012 or later only), but requires additional configuration and components (including SharePoint).
- Distributed Replay Client is available (SQL Server 2012 or later only), but not installed. To run setup, see Additional instances of the database engine and the platform provided SQL Server image.
- All tools, including SQL Server Management Studio, SQL Server Configuration Manager, the Business Intelligence Development Studio, SQL Server Setup, and upgrade and migration tools, such as Data-tier applications (DAC), backup, restore, attach, and detach.
- Client Tools Connectivity, Client Tools SDK, and SQL Client Connectivity SDK.
- SQL Server Books Online, but requires configuration by using Help Viewer. For more information, see Use Product Documentation for SQL Server.
Database engine configuration
- Contains a default (unnamed) instance of the SQL Server Database Engine, listening only on the shared memory protocol.
- By default, Azure selects Windows Authentication during SQL Server virtual machine setup. If you want to use the sa login or create a new SQL Server account, you need to change the authentication mode. For more information, see Security Considerations for SQL Server in Azure Virtual Machines.
- The Azure user who installed the virtual machine is initially the only member of the SQL Server sysadmin fixed server role.
- The Database Engine memory is set to dynamic memory configuration. Contained database authentication is off. The default language is English. Cross-database ownership chaining is off. For more settings, examine the instance of SQL Server.
- Additional installations of SQL Server can be installed on the virtual machine, but they might require a PID (Product ID code).
- The Customer Experience Improvement Program (CEIP) is enabled. You can disable the CEIP by using the SQL Server Error and Usage Reporting utility. To launch the SQL Server Error and Usage Reporting utility; on the Start menu, click All Programs, click Microsoft SQL Server version, click Configuration Tools, and then click SQL Server Error and Usage Reporting. If you do not want to use an instance of SQL Server with CEIP enabled, you might also consider deploying your own virtual machine image to Azure. For more information, see Creating and Uploading a Virtual Hard Disk that Contains the Windows Server Operating System.
Important recommendations for SQL Server configuration
- Performance considerations: While running SQL Server in Azure Virtual Machines, we recommend that you continue using the same database performance tuning options that are applicable to SQL Server in on-premises server environment. However, the performance of a relational database in a public cloud depends on many factors such as the size of a virtual machine, and the configuration of the data disks. For most up-to-date information, see Performance Best Practices for SQL Server in Azure Virtual Machines. This topic includes information on the placement of data and log files, temporary storage drive, caching, I/O performance, and so on.
- High availability and disaster recovery considerations: For databases running in SQL Server VMs in Azure, follow the detailed guidance given at High Availability and Disaster Recovery for SQL Server in Azure Virtual Machines. For applications that are running in Azure and at the same time using SQL Server in Azure VMs, additional considerations apply. We strongly recommend that you read the information given at Development Strategies in Azure: Comparison of Traditional Web Development vs. Azure Cloud Services and Azure Web Sites in the Application Patterns and Development Strategies for SQL Server in Azure Virtual Machines article.
- Services: Disable any unused services that are running on your virtual machine in Azure. For example, if you are not using some preinstalled SQL Server services, such as Analysis Services, Reporting Services, or Integration Services; disable them.
- Autoscaling: The AutoScale feature in Azure allows you to automatically increase or decrease the Virtual Machines that are used by your application. This feature guarantees that the end-user experience is not affected negatively during peak periods, and VMs are shut down when the demand is low. It’s recommended that you do not set the AutoScale option for your cloud service if it includes SQL Server VMs. The reason is that the AutoScale feature lets Azure to turn on a virtual machine when the CPU usage in that VM is higher than some threshold, and to turn off a virtual machine when the CPU usage goes lower than it. The AutoScale feature is useful for stateless applications, such as web servers, where any VM can manage the workload without any references to any previous state. However, the AutoScale feature is not useful for stateful applications, such as SQL Server, where only one instance allows writing to the database. Note: To configure the AutoScale for your VMs, you need to make sure that they are in the same availability set and in the same cloud service. To create VMs in the same cloud service, simply create the first VM, create the second VM, and then connect the second one to the first one. For information, see Tutorial: Configure and connect multiple SQL Server virtual machines in the same cloud service in Azure. For information about virtual machines and availability sets, see Manage the Availability of Virtual Machines.
For more recommendations, best practices, and tutorials, see the topics listed in the section Next steps at the end of this topic.
How to connect to the instance of SQL Server in a Azure Virtual Machine
Connect from Management Studio running on the virtual machine
In the Management Studio Connect to server dialog box, enter the host name of the virtual computer in the Server name box.
Connect from the Internet by using SQL Server Management Studio
Before you can connect to the instance of SQL Server from the Internet, the following tasks must be completed:
- Configure SQL Server to listen on the TCP protocol and restart the Database Engine.
- Open TCP ports in the Windows firewall.
- Configure SQL Server for mixed mode authentication.
- Create a SQL Server authentication login.
- Create a TCP endpoint for the virtual machine.
- Determine the DNS name of the virtual machine.
For step-by-step instructions, see Provision a SQL Server Virtual Machine on Azure.
Connect from Management Studio running on another computer using Azure Virtual Network
Azure Virtual Network allows a virtual machine hosted on Azure to interact more easily with your private network. There are multiple steps to configure the Azure Virtual Network settings. For more information about Azure Virtual Network, see Azure Virtual Network Overview.
- Configure a Azure Virtual Network.
- Enable remote access by using SQL Server Configuration Manager. Restart the Database Engine.
- Open TCP port 1433 in the Windows firewall for the default instance of the Database Engine. Open additional ports for other components as needed. For more information, see Configuring the Windows Firewall to Allow SQL Server Access and Tutorial: Connect ASP.NET application to SQL Server in Azure via Virtual Network.
Connect from your application running on another computer
Provide a connection string similar to
add name ="connection" connectionString ="Data Source=VM_Name;Integrated Security=true;" providerName ="System.Data.SqlClient";
where VM_Name is the name you provided for your virtual machine during setup. For different connectivity scenarios, see Connectivity Considerations for SQL Server in Azure Virtual Machines.
Additional instances of the database engine and the platform provided SQL Server image
If you create a virtual machine by using a platform-provided SQL Server image, you can find the SQL Server setup media saved on the virtual machine in the C:\SqlServer_SQLMajorVersion.SQLMinorVersion_Full
directory. You can run setup from this directory to perform any setup actions including add or remove features, add a new instance, or repair the instance if the disk space permits. Note that Azure provides multiple versions of the SQL Server images on the portal. If the version release date of SQL Server platform-provided image is May 15th, 2014 or later, it contains the product key by default. If you provision a virtual machine by using a platform-provided SQL Server image that is published before this date, that VM does not contain the product key. As a best practice, we recommend that you always select the latest image version when you provision a new VM.
You can capture a SQL Server virtual machine and use it as template to create other virtual machines. Provisioning a new virtual machine by using the image template does not violate the platform-provided SQL Server license. For more information, see How to Capture a Windows Virtual Machine to Use as a Template. If you bring your own SQL Server image to Azure, and then need to install additional SQL Server features, make sure to have sufficient disk space in your virtual machine. For more information on Windows Server and SQL Server licenses in the Azure platform, see Virtual Machines Licensing FAQ.
Create new logins and users
Once you create a virtual machine by using the platform provided SQL Server image, you can create new Windows users, SQL Server Windows Authentication logins, and database users as you would any on-premises database. If you intend to use SQL Server Authentication, you must configure the Database Engine for mixed mode authentication. The sa account is disabled. For information about how to change the authentication mode and enable the sa account, see Change Server Authentication Mode.
Next steps
- Getting Ready to Migrate to SQL Server in Azure Virtual Machines
- SQL Server Deployment in Azure Virtual Machines
- Connectivity Considerations for SQL Server in Azure Virtual Machines
- Performance Best Practices for SQL Server in Azure Virtual Machines
- Security Considerations for SQL Server in Azure Virtual Machines
- High Availability and Disaster Recovery for SQL Server in Azure Virtual Machines
- SQL Server Business Intelligence in Azure Virtual Machines
- Backup and Restore for SQL Server in Azure Virtual Machines
- Technical Articles for SQL Server in Azure Virtual Machines
- Videos:
See Also
Other Resources
[SQL in Azure] Getting Started with SQL Server in Azure Virtual Machines的更多相关文章
- SQL Azure (14) 将云端SQL Azure中的数据库备份到本地SQL Server
<Windows Azure Platform 系列文章目录> 注意: 1.只有SQL Server 2012 CU4及以上版本才支持本章内容 2.当你的数据库文件很大时,建议优化以下内容 ...
- 迁移 SQL Server 到 Azure SQL 实战
最近有个维护的项目需要把 SQL Server 2012 的数据库迁移到 Azure SQL 上去.主要是因为租用的主机到期,而运营商停止了主机租赁业务,看来向云端的迁移是大势所趋啊!经过一番折腾最终 ...
- [SQL in Azure] High Availability and Disaster Recovery for SQL Server in Azure Virtual Machines
http://msdn.microsoft.com/en-us/library/azure/jj870962.aspx Microsoft Azure virtual machines (VMs) w ...
- Azure 虚拟机上的 SQL Server 常见问题
本主题提供有关运行 Azure 虚拟机中的 SQL Server 时出现的一些最常见问题的解答. 如果本文未解决你的 Azure 问题,请访问 MSDN 和 CSDN 上的 Azure 论坛. 你可以 ...
- 如何將 MySQL 資料庫轉移到 Microsoft SQL Server 與 Azure SQL Database
MySQL 是相當常用之資料庫伺服器,而微軟雲端服務 Microsoft Azure 上 Azure SQL Database 是一個功能強大且經濟實惠的選擇,透過本篇文章,使用 SQL Server ...
- SQL索引管理器 - 用于SQL Server和Azure上的索引维护的免费GUI工具
我作为SQL Server DBA工作了8年多,管理和优化服务器的性能.在我的空闲时间,我想为宇宙和我的同事做一些有用的事情.这就是我们最终为SQL Server和Azure 提供免费索引维护工具的方 ...
- SQL Azure (16) 创建PaaS SQL Azure V12数据库
<Windows Azure Platform 系列文章目录> 本文介绍的是国内由世纪互联运维的Azure China 最新的Azure PaaS SQL Database(SQL Azu ...
- SQL Server SQL性能优化之--通过拆分SQL提高执行效率,以及性能高低背后的原因
复杂SQL拆分优化 拆分SQL是性能优化一种非常有效的方法之一, 具体就是将复杂的SQL按照一定的逻辑逐步分解成简单的SQL,借助临时表,最后执行一个等价的逻辑,已达到高效执行的目的 一直想写一遍通过 ...
- SQL ServerOVER 子句,over开窗函数,SQL SERVER 开窗函数
https://technet.microsoft.com/zh-cn/library/ms189461(v=sql.105).aspx http://www.cnblogs.com/85538649 ...
随机推荐
- Javascript判断Crontab表达式是否合法
这段时间在做Quartz任务调度,使用的Crontab表达式实现的.Crontab由前端页面输入,作为参数穿入后台. 虽然Quartz具有校验Crontab表达式的方法,如下: boolean cro ...
- 微信小程序开发学习资料
作者:初雪链接:https://www.zhihu.com/question/50907897/answer/128494332来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明 ...
- SITEMAP放到独立的文件上面
<siteMap configSource="Config\siteMap.config"/> </system.web> <siteMap> ...
- e藏在哪里?
e约等于2.718,是和pi齐名的自然常数. 在任何一个均匀随机器中,都藏着e. import random def count(): k = 0 s = 0 while s < 1: k += ...
- 理解iOS与函数式编程
有时候,一个关键字就是一扇通往新世界的大门.两年前,身边开始有人讨论函数式编程,拿关键字Functional Programming一搜,全是新鲜的概念和知识,顺藤摸瓜,看到的技术文章和框架也越来越多 ...
- shell脚本中解决SCP命令需要输入密码的问题
使用密钥文件. 这里假设主机A(192.168.100.3)用来获到主机B(192.168.100.4)的文件. 在主机A上执行如下命令来生成配对密钥: ssh-keygen -t r ...
- 代码管理(五)git 删除分支
1.删除远程分支 在远程下面,选择需要删除的分支,右击,选择删除 2. 删除不存在远程对应分支的本地分支 在远程上建立了一个分支feature,后来leader觉得不合理,就把远程feature分支 ...
- UI自动化测试元素定位思想
2014年的最后一天,以一篇短文纪念一下. 经常看到有同学说UI自动化测试定位难,找不到北.这话是不错的,定位是难,灵活且复杂,需要经验加技术,但是有写东西是可以提炼出来作为思想去推而广之的. 简单来 ...
- 第3章 Python基础-文件操作&函数 文件操作 练习题
一.利用b模式,编写一个cp工具,要求如下: 1. 既可以拷贝文本又可以拷贝视频,图片等文件 2. 用户一旦参数错误,打印命令的正确使用方法,如usage: cp source_file target ...
- Python 文件 readline() 方法
描述 Python 文件 readline() 方法用于从文件读取整行,包括 "\n" 字符.如果指定了一个非负数的参数,则返回指定大小的字符数,包括 "\n" ...