Azure SQL Database connection strings

Microsoft SqlClient Data Provider for SQL Server

Standard

Server=tcp:myserver.database.windows.net,1433;Database=myDataBase;User ID=mylogin@myserver;Password=myPassword;Trusted_Connection=False;Encrypt=True;

Use 'mylogin@myserver' for the User ID parameter.

With MARS enabled

Server=tcp:myserver.database.windows.net,1433;Database=myDataBase;User ID=mylogin@myserver;Password=myPassword;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;

Integrated Windows authentication with an Azure AD identity

To connect with integrated authentication and Azure AD identity, Authentication should be set to Active Directory Integrated. The client must be running on a machine joined to the domain.

Server=tcp:myserver.database.windows.net,1433;Authentication=Active Directory Integrated;Database=mydatabase;

Note! You cannot use Integrated Security=True/SSPI when connecting to Azure SQL Database.

.NET Framework Data Provider for SQL Server

Standard

Server=tcp:myserver.database.windows.net,1433;Database=myDataBase;User ID=mylogin@myserver;Password=myPassword;Trusted_Connection=False;Encrypt=True;

Use 'mylogin@myserver' for the User ID parameter.

With MARS enabled

Server=tcp:myserver.database.windows.net,1433;Database=myDataBase;User ID=mylogin@myserver;Password=myPassword;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;

Integrated Windows authentication with an Azure AD identity

To connect with integrated authentication and Azure AD identity, Authentication should be set to Active Directory Integrated. The client must be running on a machine joined to the domain.

Server=tcp:myserver.database.windows.net,1433;Authentication=Active Directory Integrated;Database=mydatabase;

Note! You cannot use Integrated Security=True/SSPI when connecting to Azure SQL Database.

Microsoft OLE DB Driver for SQL Server

SQL authentication

Provider=MSOLEDBSQL;Data Source=myServer;Initial Catalog=myDatabase;Authentication=SqlPassword;User ID=myUserName;Password=myPassword;Use Encryption for Data=true;

SQL Server Native Client 11.0 OLE DB Provider

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;

SQL Server Native Client 10.0 OLE DB Provider

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 10.0 ODBC Driver

Standard security Azure

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