This article provides guidelines on how to sign up for Windows Azure SQL Database and how to get started creating SQL Database servers and databases.
To start using SQL Database, you must first purchase a Windows Azure Platform subscription by visiting the Windows Azure Platform Offers page or the Microsoft Online Services Customer Portal. Free trial is available.
Important: A single account may contain zero or more subscriptions. An account represents the way that you establish a billing relationship with Microsoft. A single Windows Azure Platform subscription can contain multiple services, such as Windows Azure, Windows Azure AppFabric, Windows Azure Marketplace and SQL Database.
Creating a subscription involves the following steps:
For a step-by-step guide, see Acquire and Activate a Trial or Subscription: A Step-by-Step Guide.
Sign in at the Windows Azure Management Portal using a Windows Live ID account associated to the Windows Azure Platform subscription.
The Home view is shown when you first log in. Click New Database Server or the Database button as highlighted in the following screenhot.
On the Database view, expand Subscriptions and click the subscription that the server will be associated with. Make sure the status of the subscription is Ready. Click the server Create button highlighted in the following screenshot.
On the first page of the Create Server wizard, choose a geographical region where the server will be located then click Next.
Choose the closest region to avoid a bandwidth-based fee and achieve the best performance. For more information on bandwidth costs, see Accounts and Billing in SQL Database.
On the next screen, enter a new administrator login name and password for the SQL Database server and then click Next. These credientials represent the server-level principal similar to the System Administrator (sa) login in SQL Server. This account will be used to access and manage the new SQL Database server. For more information on creating user-level logins see Managing Databases and Logins in SQL Database.
The firewall rules page is shown next. In order to access the new SQL Database server outside the Windows Azure Management Portal, you must specify one or more firewall rules. The checkbox labeled Allow other Windows Azure services to access this server should be checked if you want to allow other Windows Azure services and applications to access your SQL Database Server. Click the Add button to add a firewall rule for each IP address ranges that will be permitted to access your new SQL Database server. After adding firewall rules for each IP address range, click Finish.
Note: You can change the firewall rules later by clicking the server in the Windows Azure Management Portal and click clicking the Firewall Rules button in the server view.
The server is created with a master database that contains the firewall rules. Proceed to the next section which describes creating a new database on the Windows Azure Management Portal.
Once you have created your server, you can create your SQL Databases by using the Windows Azure Management Portal or connecting to the master database and running the CREATE DATABASE statement. A master database is created automatically with the SQL Database server. You must be connected to the master database whenever you use the CREATE DATABASE, ALTER DATABASE, or DROP DATABASE statements. If you do not specify a database in the connection string, you will be connected to the master database by default. An example connection string is provided in this section. This section describes using the Windows Azure Management Portal to create a test database.
Log into the Windows Azure Management Portal, select one of the servers associated to the subscription and click the database Create button.
Enter the Database name, Edition, and Maximum size for the new database and then click OK. For more information on different database sizes and editions, see Accounts and Billing in SQL Database.
SQL Database creates the new database according to your specifications as shown in the following screenshot.
Each SQL Database server has a fully qualified unique domain name, such as servername.database.windows.net. The servername refers to the name of your SQL Database server. You can use the fully qualified DNS name to build connections strings for your database. The following are two example connection strings based on this example database...
Server=tcp:b8fiitc6yr.database.windows.net;Database=TestDB;User ID=MyAdmin@b8fiitc6yr;Password=myPassword;Trusted_Connection=False;Encrypt=True;
Driver={SQL Server Native Client 10.0};Server=tcp:b8fiitc6yr.database.windows.net;Database=TestDB;Uid=MyAdmin@b8fiitc6yr;Pwd=myPassword;Encrypt=yes;
To test connectivity for a login, click the new database under the subscription or in the database list. Then click the Test Connectivity button to test connectivity using a login you created.
On the Test Connectivity dialog, enter the login name and password that you want to test connectivity with. The click Connect. The dialog should indicate success as shown in the following screenshot.
Note: You must enable the Allow other Windows Azure services to access this server firewall rule to use the test connectivity feature.
After you have created your SQL Database server, databases, and set the firewall rules, you can connect to your SQL Database by using the sqlcmd utility and the SQL Server 2008 R2 Management Studio. For more information, see Developing and Deploying with SQL Database.
An online database management tool is available on the Windows Azure Management Portal. It can be accessed by clicking a database and then clicking the Manage button on the Windows Azure Management Portal. For more information see MSDN documentation for the Database Manager for SQL Database.
Just like SQL Server, SQL Database allows you to create additional logins and users. For more information, see Managing Databases and Logins in SQL Database.
SQL Database also allows you to use a subset of the Transact-SQL query language to query a database and to insert, update, and delete data in tables in a database. For more information, see Transact-SQL Reference.
When you write applications for SQL Database, you can use one of the .NET Framework programming languages, which come with Visual Studio 2008 or later: Microsoft Visual Basic, Microsoft Visual C#, or Microsoft Visual C++. You can also use the ADO.NET data provider for SQL Server, the SQL Server 2008 Native Client ODBC driver, and the SQL Server 2008 Driver for PHP version 1.1. For more information, see Development Guide.
Carsten Siemens edited Revision 25. Comment: Added tags: en-US, has comment, has TOC, has See Also, has image
Jonathan Gao edited Revision 23. Comment: Update the portal name
patmas57 edited Revision 22. Comment: Branding update
patmas57 edited Revision 21. Comment: Branding updates
Jonathan Gao edited Revision 16. Comment: fix the tutorial link
Jonathan Gao edited Revision 15. Comment: add a see also section with 3 links
Jonathan Gao edited Revision 14. Comment: minor editing
Good starting point when you want to work with SQL Azure.
Good Article.
Good Starting Point.
GOOD ARTICLE!!!