Publishing A Web Site As A Cloud Service: Page 1 of 55
Publishing A Web Site As A Cloud Service: Page 1 of 55
Page 1 of 55
Publishing Simple Web Site to Windows Azure Platform
v1.03 10.20.09
Also this document assumes you have already created a website on your
local PC and the website has .aspx web pages and associated folders. In this
example, Microsoft Expression Web 3 was used to create a simple website.
The site requires a Windows Live ID. Trying out the Azure services is free;
Page 2 of 55
however a token is required to gain access to some of the services. Click
the “Register for Azure Services” link below to begin the process.
https://www.microsoft.com/azure/register.mspx
Page 3 of 55
• This will take you to the Microsoft Connect site. Choose "Continue" to
register.
Page 4 of 55
Page 5 of 55
• You will then continue with the registration process
• And verify your email address (this is where the Azure token will be
emailed)
Page 6 of 55
You will get an invitation code sent your Connect email which may several
business days.
Page 7 of 55
While we wait for the Azure Invitation Code, at this point in the tutorial we
will proceed to install the Web services, Web development tools and Azure
SDK.
Page 8 of 55
Install the Web services, Web development tools and Azure SDK
Install Visual Web Developer 2008 Express Edition:
• If you haven’t already done so, download and install Visual Web
Developer 2008 Express Edition. It will take about 20 minutes to
install. Go to this Web site to install it: http://go.microsoft.com/?
linkid=7729281. You will see a series of installation messages (shown
below). Click on Next on the next few install dialog windows. Then click
on Install when prompted.
Page 9 of 55
If Microsoft Silverlight Runtime is not already installed, include it by
checking it off, along with Microsoft SQL Server 2008 Express Edition to
install.
Page 10 of 55
Page 11 of 55
If you prefer, you can register Microsoft Visual web Developer 2008
later:
Page 12 of 55
Page 13 of 55
Page 14 of 55
Turn on Internet Information Services, WWWSVCS & Application Development Features
Page 15 of 55
Install Windows Azure Tools for Visual Studio
• If you haven’t already done so, download and install Windows Azure
Tools for Visual Studio: http://go.microsoft.com/fwlink/?LinkId=128752.
Page 16 of 55
• You may get a message letting you know the following products will be
affected by the installation. Click Next.
• Then, accept the Windows Azure Tools License Terms and click on
Next.
Page 17 of 55
Page 18 of 55
Enter Azure Invitation Code & Claim Token
• Once you have received your Azure Invitation code in an email you are
ready to then claim your Azure Token so that you can proceed with this
"single Web site on Azure" tutorial.
Page 19 of 55
• Go to Azure.com click on Sign In
Page 20 of 55
• A Windows Live log-on screen may appear. Log-on with the Windows Live
ID you used to create your Azure account.
NOTE: Two possible Azure Token steps may then be presented - follow the
steps on the left or the right column, depending on what screen appears.
If this is a new Windows Azure Alternatively, you may see the screen
account you will be asked to agree below
with the Privacy Statement.
Click on I Agree
Page 21 of 55
Then click on Continue You then click on Account in the top
middle tab and then Tokens at the
left navigation bar
You will then redeem your invitation You would then enter in your
token by entering in the invitation Invitation Code and click on Claim
code from the email you received and Token
clicking on Next
Page 22 of 55
•
Then click on Accept to accept the And then you would click on Accept
Terms if Use
Page 23 of 55
Set up an Azure Hosted Service
• An Azure Project name is already created for you. Click on your Azure
Project name.
Page 24 of 55
• Then click on Hosted Services. This tutorial will demonstrate how to get
a Web site hosted on Azure.
Page 25 of 55
• Then enter in a Service Label and a Service Description. Click Next.
Page 26 of 55
• If the name is available click Create.
Page 27 of 55
• The Azure Service is now ready to accept the Web site .aspx pages and
any associated Web site folders that you will include in a Visual Web
Developer project WebRole.
Page 28 of 55
Creating The Visual Web Dev Project So A Web Site Can Be Uploaded To
Azure
• Open Visual Web Developer Express 2008.
• Choose ASP.NET WebRole as your project type for a Web site and click
on right arrow to add to Cloud Service Solution followed by OK.
Page 29 of 55
• This will then launch the Visual Web Developer project:
• At this point new Visual Web Developer project files have been created in
the Location specified in File-New Project - you can look at these files and
folders in Windows Explorer:
Page 30 of 55
• Assuming you have already created a website on your local PC and the
website has .aspx web pages and associated folders. In this example,
Microsoft Expression Web 3 was used to create a simple website.
• Now, we want to add the previously created website files and folders into
the WebRole and we do this by simply copying over those files and folders
using Windows Explorer
Page 31 of 55
• We then paste these files onto the WebRole1 Assembly in Visual Web
Developer Solution Explorer
Page 32 of 55
• Azure does not require the Web Expression 3 _vti folders and master.dwt
file folders and files, so we will delete them (at the time of writing, your
web site may not load if the _vti folders are not removed)
Page 33 of 55
• To test that the web site will run locally on your PC, right-click on the
WebRole1 and select Set as Startup Project
• Then right-click on the default.aspx file and select Set as Start Page
Page 34 of 55
• To test the Web site, click on Debug - Start Without Debugging. If
you do instead select Debug - Start Debugging You may get a
Debugging Not Enabled dialog, select Run without debugging
(Equivalent to Ctrl+F5). for This simple tutorial, we do not want to
change the Web.config file before deploying to Azure.
• You may also get a Development Storage dialog box asking for permission
to perform development storage initialization, click on Yes.
Page 35 of 55
Page 36 of 55
Debugging will launch a local instance of the Web site in your Web browser
so you can see what the Web site will look like.
Page 37 of 55
Page 38 of 55
• Once the compiler completes the building and packaging of the website,
Windows Explorer will open to the folder containing the Service
Configuration file and Service Package (.cspkg). These files, along with
the Service Configuration file (cscfg), are the files you upload via the
Azure Services Developer Portal to run your application on Windows
Azure.
Page 39 of 55
• A Web browser window will open to the Azure Services Developer Portal
where you can upload and deploy your service. Click on the Project
Name.
Page 40 of 55
Page 41 of 55
• With Windows Azure you can put your web site in a “staging area” – this
means you can test the functionality of your web site before going into
production. To see the Production Area and the Staging Area, click on the
vertical bar in the Azure service screen
Page 42 of 55
• In this tutorial we will test the web site in the Staging Area before going in
to Production. In the Staging section, click on Deploy
Page 43 of 55
Page 44 of 55
• Now you will need to upload the Visual Web Developer configuration files:
>> App Package: filename.cspkg
>> Configuration Settings: ServiceConfiguration.cscfg
Page 45 of 55
• Choose a Service Deployment Name and then click Deploy.
Page 46 of 55
• After a few minutes, you will then see your Web site is Allocated and is on
a “staging site”. And the Web site is almost ready to go into live
production.
Page 47 of 55
• Because the Web site is on a staging site, from Staging, you can test your
Cloud Service on a staging URL by first clicking “Run”.
Page 48 of 55
• This will put your WebRole in the Initializing state which will take about
20-30 minutes
Page 49 of 55
• Then your Staging WebRole will be in a Started state:
Page 50 of 55
• Once your Staging WebRole has been started, you can test the Web site
by navigating to the staging URL. (the cloudapp.net URL that begins with
a series of letters and numbers e.g.:
http://76c0282a84764a66a2d.cloudapp.net etc).
Page 51 of 55
• After you are happy with your Cloud Service on staging, you can promote
it to production by clicking on the promote button.
Page 52 of 55
Page 53 of 55
• Answer OK to promote to production deployment
• Your Web site will now be Started and live and in production
Page 54 of 55
• The final URL will be http://YourProjectName.cloudapp.net.
Page 55 of 55