0% found this document useful (0 votes)
113 views

Publishing A Web Site As A Cloud Service: Page 1 of 55

This document provides steps to publish a simple web site to the Windows Azure platform, including: 1. Obtaining an Azure account and waiting to receive an invitation code via email. 2. Installing requisite software like Visual Web Developer 2008 Express Edition and the Windows Azure SDK. 3. Claiming an Azure token by entering the invitation code. 4. Creating an Azure hosted service. 5. Using Visual Web Developer to create a project with a WebRole containing existing website files and folders. 6. Uploading the project to the hosted service on Azure, staging it, and publishing the staged version for testing on Azure.

Uploaded by

api-26146133
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
113 views

Publishing A Web Site As A Cloud Service: Page 1 of 55

This document provides steps to publish a simple web site to the Windows Azure platform, including: 1. Obtaining an Azure account and waiting to receive an invitation code via email. 2. Installing requisite software like Visual Web Developer 2008 Express Edition and the Windows Azure SDK. 3. Claiming an Azure token by entering the invitation code. 4. Creating an Azure hosted service. 5. Using Visual Web Developer to create a project with a WebRole containing existing website files and folders. 6. Uploading the project to the hosted service on Azure, staging it, and publishing the staged version for testing on Azure.

Uploaded by

api-26146133
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 55

Table of Contents

Publishing Simple Web Site to Windows Azure Platform..................................2


In this tutorial you will:.................................................................................2
Pre-requisites................................................................................................2
Obtain Azure Account................................................................................2
Install the Web services, Web development tools and Azure SDK............7
Turn on IIS in Windows............................................................................10
Turn on Internet Information Services, WWWSVCS & Application
Development Features............................................................................12
Install Windows Azure Tools for Visual Studio.........................................13
Enter Azure Invitation Code & Claim Token................................................16
Set up an Azure Hosted Service.................................................................21
Creating The Visual Web Dev Project So A Web Site Can Be Uploaded To
Azure..........................................................................................................25
Publishing a Web site as a Cloud Service...................................................34
Publishing a Web site as a Cloud Service

Page 1 of 55
Publishing Simple Web Site to Windows Azure Platform
v1.03 10.20.09

In this tutorial you will:

a. Register for an Azure account


b. Install the requisite Web services, SDK and software
c. Claim your Azure token after the invitation code is received
d. Create a Hosted Service in Azure
e. Create a Visual Web Developer ASP.NET “cloud” project
f. Create or use existing .aspx website files and folders
g. Copy your created or existing .aspx website files and folders to
the Azure WebRole
h. Upload your project to the Hosted Service in Azure
i. Stage the Web site on Azure
j. Test the Web site on Azure
k. Publish the staged project into production
l. Accept and Deploy your project in the Azure “cloud”.
Pre-requisites
Several pieces must first come together before hosting the Web site on
Azure: Software must be installed, and Azure account must be created and
token redeemed. This document will walk you through the process of
obtaining all required software all the way through to publishing a simple
Web site to Azure.

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.

Obtain Azure Account

If you haven’t already done so, sign up for an Azure account at


http://www.microsoft.com/windowsazure/developers/ and click on Get Your
Account

IMPORTANT this step requires you to register on Microsoft


Connect to setup an Azure account which requires an Invitation
code. This invitation code can take several business days to
receive. It will arrive via email to the email address associated
with your Live ID.

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

• Click on Register for Azure Services

Page 3 of 55
• This will take you to the Microsoft Connect site. Choose "Continue" to
register.

• Then click on I Agree to continue to register with Microsoft Connect

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:

Turn on IIS in Windows


In Windows, if you haven’t already done so, turn on IIS via the Control
Panel by doing the following steps:
• Control Panel -> Programs -> Turn Windows features on or
off)

Page 12 of 55
Page 13 of 55
Page 14 of 55
Turn on Internet Information Services, WWWSVCS & Application Development Features

Turn on Internet Information Services, World Wide Web Services, and


Application Development Features. NET Extensibility, ASP.NET,
ISAPI Extensions and Filters by checking off these boxes and click OK.

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.

• At installation completion click on Finish.

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

• Then at the next screen, click on Windows Azure.

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

Then click on Continue Then click on Continue

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.

• Then click on New Service.

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.

• Choose a hosted service name and Check Availability.

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.

Note: Make sure you Run as Administrator or when you try to


debug you will get an error.

• Go to File-New Project and create a new Cloud Service and enter in a


Name and a Solution Name, followed by OK.

• 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

• Answer Yes to the Copy prompts

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.

Publishing a Web site as a Cloud Service


• Create the Service Package (cspkg) by right clicking on the Cloud
Service project node. This is the Service Label name you gave at the
beginning in Azure. Select Publish.

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.

• Then click on the Hosted Service you already created.

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

You might also like