Connection strings for SQL Azure

The SQL Azure Database service is only available with TCP port 1433. Ensure that your firewall allows outgoing TCP communication on TCP port 1433.

SQL Azure does not support Windows Authentication. The Trusted Connection will always be set to False.

SQL Azure doesn’t support unencrypted connections. You need to specify in your connection string that you want to encrypt the connection.

Connecting to SQL Azure by using OLE DB is not officially supported.

.NET Framework Data Provider for SQL Server

Type .NET Framework Class Library
Usage System.Data.SqlClient.SqlConnection
Manufacturer Microsoft

Standard

Server=tcp:[serverName].database.windows.net;Database=myDataBase;
User ID=[LoginForDb]@[serverName];Password=myPassword;Trusted_Connection=False;Encrypt=True;

Use 'username@servername' for the User ID parameter.

 
 

With MARS enabled

MARS was enabled in SQL Azure Service Update 2

Server=tcp:[serverName].database.windows.net;Database=myDataBase;
User ID=[LoginForDb]@[serverName];Password=myPassword;Trusted_Connection=False;Encrypt=True;
MultipleActiveResultSets=True;
 
 

SQL Server Native Client 10.0 ODBC Driver

Type ODBC Driver
Usage Driver={SQL Server Native Client 10.0}
Manufacturer Microsoft

Standard security

Driver={SQL Server Native Client 10.0};Server=tcp:[serverName].database.windows.net;
Database=myDataBase;Uid=[LoginForDb]@[serverName];Pwd=myPassword;Encrypt=yes;

Use 'username@servername' for the User ID parameter. Servername is the servername portion of the server parameter, i e 'myNamedServer' of tcp:myNamedServer.database.windows.net

 
 

SQL Server Native Client 10.0 OLE DB Provider

Type OLE DB Provider
Usage Provider=SQLNCLI10
Manufacturer Microsoft

Standard

Microsoft does not announce support for OLE DB connections to Azure and there are limitations. Some required OLE DB schema rowsets are not available from an Azure connection, and some properties that identify features in SQL Server are not adjusted to represent SQL Azure limitations. For most common connect/query/update tasks it seems to work fine.

Provider=SQLNCLI10;Password=myPassword;User ID=[username]@[servername];
Initial Catalog=databasename;Data Source=tcp:[servername].database.windows.net;
 
 

SQL Server Native Client 11.0 OLE DB Provider

Type OLE DB Provider
Usage Provider=SQLNCLI11
Manufacturer Microsoft

Standard

Microsoft does not announce support for OLE DB connections to Azure and there are limitations. Some required OLE DB schema rowsets are not available from an Azure connection, and some properties that identify features in SQL Server are not adjusted to represent SQL Azure limitations. For most common connect/query/update tasks it seems to work fine.

Provider=SQLNCLI11;Password=myPassword;User ID=[username]@[servername];
Initial Catalog=databasename;Data Source=tcp:[servername].database.windows.net;
 
 

.NET Framework Data Provider for ODBC

Type .NET Framework Wrapper Class Library
Usage System.Data.Odbc.OdbcConnection
Manufacturer Microsoft

Use an ODBC driver from .NET

Driver={any odbc driver's name};OdbcKey1=someValue;OdbcKey2=someValue;

See the respective ODBC driver's connection strings options. The .net OdbcConnection will just pass on the connection string to the specified ODBC driver. Read more here.

 
 

.NET Framework Data Provider for OLE DB

Type .NET Framework Wrapper Class Library
Usage System.Data.OleDb.OleDbConnection
Manufacturer Microsoft

Use an OLE DB provider from .NET

Provider=any oledb provider's name;OledbKey1=someValue;OledbKey2=someValue;

See the respective OLEDB provider's connection strings options. The .net OleDbConnection will just pass on the connection string to the specified OLEDB provider. Read more here.

 
 

Popular