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.
Select Publish from the pop-up menu. You should see the Publish Cloud
Service dialog box.
Choose the option to "Create Service Package Only" and click
the OK button.
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.
Open up Internet Explorer and navigate to https://windows.azure.com/
Once you log in to your account you should see your home page.
Click on the "New Hosted Service" button in the upper left
hand corner of the page.
This will display the "Create a new Hosted Service" dialog.
Enter "ASPAllianceSample" for the name.
"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.
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
"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.
"ASPAllianceSample" for the "Deployment Name".
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.
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.
hosted service will then be created after a several minutes. The first time I
did this it took about 10 minutes.
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.
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
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.
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.
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