1.
Before you deploy your project to the Cloud you need to create a Service
Package using Visual Studio 2010. This is done by right clicking on the
"ASPAllianceSample" node in your solution explorer.
2.
Select Publish from the pop-up menu. You should see the Publish Cloud
Service dialog box.
3.
Choose the option to "Create Service Package Only" and click
the OK button.

4.
Visual Studio will create two files and open up Windows Explorer so you
can upload them to the Windows Azure web site. The two files are called
ASPAllianceSample.cspkg and ServiceConfiguration.csfg.

5.
Open up Internet Explorer and navigate to https://windows.azure.com/
6.
Once you log in to your account you should see your home page.

7.
Click on the "New Hosted Service" button in the upper left
hand corner of the page.
8.
This will display the "Create a new Hosted Service" dialog.

9.
Enter "ASPAllianceSample" for the name.
10. Enter
"ASPAllianceSample" for the URL Prefix. The URL Prefix must be
unique across all sites so you'll have to append a number to the end of the
prefix until the site tells you it is unique. The name you enter here is the
publicly available name that people will use to get to your web site.
11. Next,
select a region where you want your site hosted. I'll choose "Anywhere US"
for this example but you may want to choose a region closer to your target
audience.
12. Under
"Deployment options" chose "Deploy to production environment".
You can deploy to the stage environment and then promote stage to production
but for this example we'll just deploy directly to production.
13. Enter
"ASPAllianceSample" for the "Deployment Name".
14. Now
you need to upload the package and configuration files that were created by
Visual Studio. Click the "Browse Locally…" button on the respective
sections to upload the files.

15. Now
click the OK button. You'll get a warning regarding the fact that there is
only one role with one instance for this deployment. You can ignore the
warning by clicking the Yes button.
16. The
hosted service will then be created after a several minutes. The first time I
did this it took about 10 minutes.

17. Once
the service is created you can then open Internet Explorer and navigate to http://aspalliancesample.cloudapp.net/
to see your application. Remember to change the prefix in the URL to whatever
you used when you created the URL Prefix in step 10.
18. Just
when you thought you were done, you're not. If you run the application you'll
get an error. This is because you have to create a firewall rule to allow the
IP address of the hosted application to access the database. To find out the
IP address you'll need to look at the details of the error message. To do this
you'll can add a section to your web.config file and redeploy the application.
Add the following section to the <system.web> section
<customErrors mode="Off"></customErrors>
19. You'll
need to save and then publish the configuration files again. Once this setting
is in place on your server you can navigate to the site and you should get the
details of the error message in the default .NET error page.
20. You'll
need to add this IP address to the list of allowed IP addresses in the firewall
rules just as you did when you setup the database.
21. Once
the firewall rule is in place you should be able to navigate to your
application's URL and see the default page with the records from the database
displayed.
