Tuesday, January 24, 2012

Windows Azure: SQL Azure Database connection string

In this article I will show you how to get connection string for your application to connect to your SQL Azure database.
If you have had experience developing ASP.NET application, the connection string below might be familiar to you.
Data Source=<DATABASE SERVER>;Initial Catalog=<DATABASE>;User ID=<USERNAME>;Password=<PASSWORD>
However in Windows Azure Platform, the connection string is a little bit different from the above. Rather of wasting time figuring out what the connection string to your database is, you can actually get the connection string to your specific Windows Azure SQL Database right from the Windows Azure Platform Management Portal.
Assuming that you have already create your SQL Azure Database, follow the steps below to get your connection string from the Windows Azure Management Portal.
  1. Login to Windows Azure Management Portal using your Live ID at http://windows.azure.com/
  2. Once you’re logged in, click on the Database button at the lower left of the page.
  3. Click on the database you wish to view it’s connection string. Then on the Properties panel at the right side of the page, click on the button next to View. azure_mgmtPortal_content_database_connectionString
    Now, you will be able to see 3 different connection string for your database. Copy & Paste the relevant connection string.
    IMPORTANT: Review that you want to use the UserName to connect to the database. Also, you will need to change the Password for the selected user.

No comments:

Post a Comment