Yeap, you’re not looking at the wrong title, it is ASP.NET Website, not ASP.NET Application.
As you might have known, since Windows Azure SDK 1.5, you can add Windows Azure Project to your existing ASP.Net web application with few clicks. After that, VS2010 will automatically add Windows Azure project and reference the necessary dlls.
What happened was that I couldn’t deploy website to Windows Azure as Windows Azure project in VS2010 won’t allow me to add Windows Azure project to it (no option as you can see below). I’ve tried to migrate the website to web application but it is too troublesome as there are just too many websites to be converted in my case and there are many DLLs that will need to be added.
Thanks to David Aiken’s blogpost, I had use the same method to package my file to Windows Azure. However, there are some changes in Windows Azure SDK (which is v1.6) now compared to the version that David used (which is SDK 1.2).
Reminder: You will need to publish/compile the website if you had made any changes to it to generate the necessary DLLs.
- Put your website in another folder or create a new one. Something like the image below. So my website files are inside ASPWeb folder.
- Copy ServiceConfiguration.cscfg and ServiceDefinition.csdef into the new folder that you created in Step 1. If you doesn’t have the file, then please use the code as below. You can create them using notepad.
- ServiceDefinition.csdef(Configured as ExtraSmall instance)[codebox 1]
- ServiceConfiguration.cscfg[codebox 2]
- Change the RoleName inside both ServiceDefinition.csdef and ServiceConfiguration.cscfg to reflect the name of the folder that contains your website. In my case, ASPWeb.
- You can also rename your Site Name. In my case, I leave it as it is which is “Web”.
- Run Windows Azure Command Line Tool As Administrator
- CD to your website directory. For example : cd C:\Desktop\\Website2
- Execute this command. [codebox 3]
- Example: [codebox 4]
- After that, you’ll see .cspkg is created.
- Upload the .cspkg and .cscfg file using Windows Azure Management Portal. Then there you go!
Hope this is helpful for you