I need a walkthrough or steps of how to deploy ASP.NET Website on Windows Azure.
Here are the steps to deploy ASP.NET Website on Windows Azure.
Assumptions --> 1. You have already created an ASP.Net website.
Step 1: Install following things on your machine
Windows Azure SDK(http://www.microsoft.com/downloads/details.aspx?FamilyID=aa40f3e2-afc5-484d-b4e9-6a5227e73590&displaylang=en )
Windows Azure Tools for Visual Studio 2008/2010(http://www.microsoft.com/downloads/details.aspx?familyid=5664019E-6860-4C33-9843-4EB40B297AB6&displaylang=en )
-----------------------------------------------------------------------------------------
Step 2: Open Visual Studio and say New>Project and then select project type cloud from Visual C# and select Windows Azure Cloud Service template.
Give name to your project. Select Location for the same and Click on OK button
-----------------------------------------------------------------------------------------
Step 3: In New Cloud Service Project window select ASP.Net Web role and click on [>] button and say OK
-----------------------------------------------------------------------------------------
Step 4: Solution explorer will look like this-->
-----------------------------------------------------------------------------------------
Step 5: Right click on WebRole1 project from solution explorer and Click on Remove
-----------------------------------------------------------------------------------------
Step 5: After removing WebRole1 project from solution explorer
-----------------------------------------------------------------------------------------
Step 6: Now right click on Solution explorer and say Add>Existing Project and add your existing ASP.Net application to solution exlorer.
-----------------------------------------------------------------------------------------
Step 7: After adding your existing ASP.Net application to solution exlorer.
-----------------------------------------------------------------------------------------
Step 8: Right Click on CloudService1>Roles>No Project associated(WebRole1) and then say Associate With>Web Role project in solution
-----------------------------------------------------------------------------------------
Step 9: Select your existing ASP.Net Web Application in solution explorer and say OK
-----------------------------------------------------------------------------------------
Step 10: Now Hit F5 to run your cloud service.
And see the task bar. You will notice-->
And now your ASP.Net web application will run on local Developement Fabric. Your ASP.Net cloud service is still NOT ready for deploying on Windows Azure.
-----------------------------------------------------------------------------------------
Step 11: Now if you are using Third party DLLs in your ASP.Net Web Application then create a folder named Shared under solution explorer. And add all the 3rd party DLLs in that.
-----------------------------------------------------------------------------------------
Step 12: Now go to myExistingASP.NetwebSite>References> and add the 3rd party references from Shared folder created in step 11. Now select all the references added just now and set their 'Copy Local' property to true
-----------------------------------------------------------------------------------------
Step 13: If your are using session state in your ASP.Net web app then you need to use AspProvider for session state management.The Windows Azure SDK which you have installed contains a sample with session provider implementation (its having same functionality as the corresponding SQL provider. Please see the AspProvider sample and the AspProviderDemo for an example of how to use it.)
-----------------------------------------------------------------------------------------
Step 14: Make sure you catch every exception during initialization of web application and log it properly.
-----------------------------------------------------------------------------------------
Step 15: If you are using Certificate in your ASP.Net application then for your certificate to work in the cloud it needs to have exportable private key. Certificates without exportable private key are not supported. If you use Windows Certificates Manager you need to make sure to select “Yes, export the private key” option while exporting the certificate.
-----------------------------------------------------------------------------------------
Step 16: Make sure that your web.config or app.config does not contain malformed xml.
-----------------------------------------------------------------------------------------
Step 17: Now your application is ready for deploying it on Windows Azure.
-----------------------------------------------------------------------------------------
Step 18: Now go to Solution Explorer and right-click the cloud project(CloudService1) and say Publish.
-----------------------------------------------------------------------------------------
Step 19: The publish folder for your application will open in Windows Explorer, showing a package file and a config file.
-----------------------------------------------------------------------------------------
Step 20: Now what you need is Windows Azure Account. So get an Azure Account and log into that. Either create a new project on the portal or select an existing one. Then you will see Production environment on left side and Staging environment on right side.
-----------------------------------------------------------------------------------------
Step 21: Now Click on the Deploy button under Stagging. Now will be able to see following form.
-----------------------------------------------------------------------------------------
Step 22: Browse the CloudService1.cspkg file.
-----------------------------------------------------------------------------------------
Step 23: Browse the ServiceConfiguration.cscfg file.
-----------------------------------------------------------------------------------------
Step 24: Once both files have been selected, give name to this deployment and Click on Deploy button.
-----------------------------------------------------------------------------------------
Step 25: Then it will try to copy the files.
-----------------------------------------------------------------------------------------
Step 26: Then it will try to enable the deployment
-----------------------------------------------------------------------------------------
Step 27: Once deployment is enabled click on Run button.
-----------------------------------------------------------------------------------------
Step 28: Then deployment will go through following three states.
--> -->
Once you get ready state you are through. :-) Click on "Web Site URL" and your cloud app will open in new browser window.
Please let me know if you get following loop
Initializing ---> Busy --> Stopping ---> Initializing--> so on..
There's a very good walkthrough posted about 2 weeks ago here that takes you through the migration steps, including migrating a SQL Server database to SQL Azure.
If you don't have an Azure account already, you can go here to set one up.
If you're an MSDN Premium member, you're eligible for a free Azure hosting account. See my SO post here for more info about this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With