Imagine that we are moving an existing Web Application or ASP.Net MVC Web Application to cloud. In that case we need to add cloud service to an existing Web Application or ASP.Net MVC Web Application.
We have a solution for Web Application as below.
Now right click on the solution and add a new project in the same solution. Choose Windows Azure project from the installed template and then choose a ASP.Net Web Role.
In role selecting window do not select any role and click on Ok. See the image below.
Now you can see in solution explorer that a Windows Azure project is being added.
After creating a Windows Azure project we need to associate an ASP.Net Web Application project to Window Azure. So to do so, right click on Roles in Windows Azure Project and select add and then choose Web Role Project in solution option.
Then you will get the project in the solution. Press ok.
On clicking of Ok, Visual studio will update csdef and cscfg file for the Web Role.
Now add the references of required windows azure. For that click on web Application project and add references. Then add the following references.
In this way you have added a cloud service project to an existing Web application.