Entity Framework handshake with SQL Azure
I am sure many clients would consider this as one of the key consideration while planning application migration to off premise fully or partly.
Entity Framework can be used to connect to SQL Azure database in the same way as SQL Server database and it is seamless.
If you have developed any existing application with Entity Framework and SQL Server, it can be made to work with database on SQL Azure with little changes as outline here
Change the following highlighted items in the connecting string to connect to SQL Azure database
Connection String for SQL Server
<add name="NewGenBankEntities" connectionString="metadata=res://*/NewGenBankDataModel.csdl|res://*/NewGenBankDataModel.ssdl|res://*/NewGenBankDataModel.msl;
provider=System.Data.SqlClient;provider connection string="
Data Source=.\sqlexpress;
Initial Catalog=NewGenBank;
Integrated Security=True;
MultipleActiveResultSets=True""
providerName="System.Data.EntityClient"/>
Connection String for SQL Azure
<connectionStrings>
<add name="NewGenBankEntities" connectionString="metadata=res://*/NewGenBankDataModel.csdl|res://*/NewGenBankDataModel.ssdl|res://*/NewGenBankDataModel.msl;
provider=System.Data.SqlClient;provider connection string="
Data Source=xxx.database.windows.net;
Initial Catalog=NewGenBank;
Persist Security Info=True;
User ID=sqluser;
Password=xxx;
MultipleActiveResultSets=True""
providerName="System.Data.EntityClient" />
</connectionStrings>
Note that for SQL Azure, there is no Integrated Security and one needs to use SQL Server authentication. Database password can be hashed instead of having it naked in config file.
Once this is done, your application should work seamlessly with SQL Azure as a database.


