Pointing to the cloud We want our MVC application to get the data from the cloud (SQL Azure). To retrieve data from SQL Azure, it is incredibly easy:
A simple change in the MVC’s connection string will make the change
This is a relevant use case
High availability and fault tolerance is built-in and no physical administration is required for SQL Azure. This is potentially an architecture that will work for many businesses – to have the data hosted in the cloud but have the web applications (Web Forms or MVC) hosted on premise.
The Connection String – Found inapp.config
Currently configured for “On Premise” Notice that the connection string is found in App.config. Also notice that we are pointing to a Data Source=(local) .
We need to adjust the connection string in 2 placesAs you recall from a previous post, the connection string is in both projects:
DataLayer
MvcOnPremise
On Premise Web App – Cloud hosted database
Hybrid ApplicationAt this point you may decide you are done. That is, your application will be hosted ‘on-premise’ but the but he data is hosted in the cloud in SQL Azure.
Future Posts for this blog
Move MVC Web App to Windows AzureWe will conclude this series of posts by migrating our web application to the cloud. At this point, the data is in the cloud, but not the application.