Eksportér (0) Udskriv
Udvid alt
EN
Dette indhold er ikke tilgængeligt på dit sprog, men her er den engelske version.
92 ud af 115 klassificerede dette som nyttigt - Bedøm dette emne

Getting Started with SQL Server in Azure Virtual Machines

Updated: November 27, 2013

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

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 2012 Service Pack 1

Enterprise, Standard, and Web

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, 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:

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

This section contains some important recommendations that you should consider while using SQL Server in Azure Virtual Machines:

  • Placement of data files: Do not place user database files on D: drive as it is for temporary storage only. If the size of the database is smaller than 10 GB, you can place it in the operating system drive (C:). If the size of the database is greater than 10 GB, we recommend that you use an attached data disk for it. For information on attaching disks in Azure, see How to Attach a Data Disk to a Virtual Machine. As a general rule, we recommend that you keep all your database files, log files, and backup files in the attached data disk.

  • Temporary storage drive: The temporary storage drive, labeled as the D: drive is not persisted and is not saved in the Azure Blob storage. It is used primarily for the page file and its performance is not guaranteed to be predictable. Management tasks such as a change to the virtual machine size, resets the D: drive. In addition, Azure erases the data on the temporary storage drive when a virtual machine fails over. The D: drive is not recommended for storing any user or system database files, including tempdb.

  • Caching: On the data disk, both read and write caching is disabled by default. If the workload demands a high rate of random I/Os and throughput is important to you, the general guideline is to keep the cache set to the default value of disabled) on the data disk. If the workload is sensitive to latency and requires low number of concurrent read I/Os, consider enabling read cache on the data disk. It is highly recommended that you test different disk configurations to achieve optimal SQL Server performance. For more information, see Performance Considerations for SQL Server in Azure Virtual Machines.

  • Disk Striping: We recommend that you add one or more data disks only in one of the following two conditions:

    • Your database size exceeds the limitations imposed by a single data disk. Or,

    • Based on your tests, your system has an intensive I/O workload and its I/Os per second (IOPs) requirements exceed what a single data disk can provide.

    If you use more than one data disk, do the followings:

    • Distribute data files in the database filegroups instead of using operating system disk striping. For information, see Database Files and Filegroups.

    • Turn off geo-replication as it does not guarantee the consistency of data across multiple data disks.

  • I/O Performance: To achieve better I/O performance, we recommend that you do the followings:

    • Enable instant file initialization for better performance when SQL Server needs to create and grow its files (such as, restore). For more information, see Database File Initialization.

    • Use database page compression as it can help improve performance of I/O intensive workloads.

    • Keep the default value of file allocation unit size (cluster size) when you format a data disk.

    • Add additional data disks if your system has an intensive I/O workload and its I/Os per second (IOPs) requirements exceed what a single data disk can provide. If you need to attach data disks to your virtual machine, see the recommendations listed in the Disk Striping section above.



  • 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.

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.

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 the 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. 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.

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

See Also

Syntes du, dette var nyttigt?
(1500 tegn tilbage)
Tak for din feedback

Fællesskabsindhold

Tilføj
Vis:
© 2014 Microsoft. Alle rettigheder forbeholdes.