You need to download and install the following tools from here to move the applications to windows azure environment.
1. Open the Visual Studio 2010 as administrator
2. Open your existing ASP.NET Web application
3. Create a new cloud project and add to the solution as shown below. Select the Windows Azure Project template from the dialogue box and say ok
4.Do not add any roles as we add the existing application as a role and just say ok.
5. Add the ASP.NET project to the cloud project. In Solution Explorer, right-click the Roles node in the Azure project then Add and select Web Role Project in solution.
6. In the project association dialogue box select the existing project
When you said Ok in above dialogue, Visual Studio updates the ServiceDefinition.csdef and the ServiceConfiguration.cscfg files
7. Add the following assemblies to existing asp.net project as these are required to run in Azure environment.
Microsoft.WindowsAzure.Diagnostics
Microsoft.WindowsAzure.ServiceRuntime
Microsoft.WindowsAzure.StorageClient
8.To enable the diagnostics logging, add the following lines to Web.Config file in asp.net project
9. Add the following piece of code to Global.asax file in Application start event
1: Microsoft.WindowsAzure.CloudStorageAccount.SetConfigurationSettingPublisher
2: ((configName, configSetter) =>
3: {
4: configSetter(RoleEnvironment.GetConfigurationSettingValue(configName));
5: );
10. As we are moving the ASP.NET MVC application make sure that System.Web.MVC is copied to local as shown below
11. Publishing the project to client is simple, just right click on the Azure project and say publish Supply the credentials and hosted service details
Share this post : |
[…] previous post explained that changes that are necessary to run an existing ASP.NET application in the Windows […]
[…] Process described below works for both ASP.NET Web and MVC applications. You need to download… Read more… Categories: .NET Visual Studio 2010 Windows Azure […]