<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta name="generator" content="pdf2htmlEX">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="https://static.pudn.com/base/css/base.min.css">
<link rel="stylesheet" href="https://static.pudn.com/base/css/fancy.min.css">
<link rel="stylesheet" href="https://static.pudn.com/prod/directory_preview_static/627109a97b3701121450210f/raw.css">
<script src="https://static.pudn.com/base/js/compatibility.min.js"></script>
<script src="https://static.pudn.com/base/js/pdf2htmlEX.min.js"></script>
<script>
try{
pdf2htmlEX.defaultViewer = new pdf2htmlEX.Viewer({});
}catch(e){}
</script>
<title></title>
</head>
<body>
<div id="sidebar" style="display: none">
<div id="outline">
</div>
</div>
<div id="pf1" class="pf w0 h0" data-page-no="1"><div class="pc pc1 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/627109a97b3701121450210f/bg1.jpg"><div class="t m0 x1 h2 y1 ff1 fs0 fc0 sc0 ls0 ws0">Hands-On Lab<span class="ff2 ws1"> </span></div><div class="t m0 x1 h3 y2 ff3 fs1 fc1 sc0 ls1 ws2">Windows Azure: Introduction to Windows </div><div class="t m0 x1 h3 y3 ff3 fs1 fc1 sc0 ls2 ws1">Azure </div><div class="t m0 x1 h4 y4 ff4 fs2 fc0 sc0 ls3 ws1">CONTENTS </div><div class="t m0 x1 h4 y5 ff4 fs2 fc0 sc0 ls4 ws3">OVERVIEW .................<span class="_ _0"></span>...................<span class="_ _0"></span>...................<span class="_ _0"></span>...................<span class="_ _0"></span>..................<span class="_ _0"></span>...................<span class="_ _0"></span>.......<span class="_ _0"></span><span class="ls5 ws4">............<span class="_ _0"></span>................. 2</span></div><div class="t m0 x2 h5 y6 ff1 fs3 fc0 sc0 ls0 ws1"> </div><div class="t m0 x1 h5 y7 ff4 fs2 fc0 sc0 ls6 ws5">EXERCISE 1: BUILDING YOUR FIRST WINDOWS AZURE APPLICATION <span class="_ _1"></span>................<span class="_ _0"></span>...................<span class="_ _0"></span>......... <span class="_ _2"></span>4<span class="ff1 fs3 ls0 ws1"> </span></div><div class="t m0 x3 h5 y8 ff1 fs3 fc0 sc0 ls7 ws6">Task 1 – Creating the Visual Studio Project .............<span class="_ _0"></span>...................<span class="_ _0"></span>...............<span class="_ _0"></span>...................<span class="_ _0"></span>...............<span class="_ _0"></span>..<span class="_ _3"></span><span class="ls8 ws7">....... 5 </span></div><div class="t m0 x3 h5 y9 ff1 fs3 fc0 sc0 ls7 ws6">Task 2 – Creating a Data Model for Entities in Table Storage<span class="_ _4"></span> <span class="_ _2"></span>.....<span class="_ _0"></span>...............<span class="_ _0"></span>...................<span class="_ _0"></span>...............<span class="_ _0"></span>......... <span class="_ _1"></span>7 </div><div class="t m0 x3 h5 ya ff1 fs3 fc0 sc0 ls9 ws8">Task 3 – Creating a Web Role to Display the Guest Book and Process User Input <span class="_ _2"></span>......................<span class="_ _0"></span>....... <span class="_ _1"></span>20 </div><div class="t m0 x3 h5 yb ff1 fs3 fc0 sc0 ls7 ws6">Task 4 – Creating a Worker Role to Process Image<span class="_ _4"></span>s in the Background <span class="_ _5"></span>...............<span class="_ _0"></span>...................<span class="_ _0"></span>........... <span class="_ _1"></span>29 </div><div class="t m0 x3 h5 yc ff1 fs3 fc0 sc0 lsa ws6">Task 5 – Using Queues to Dispatch<span class="_ _4"></span> Jobs to the Wo<span class="ls7 ws9">rker Role <span class="_ _0"></span>........<span class="_ _0"></span>...............<span class="_ _0"></span>...................<span class="_ _0"></span>...............<span class="_ _0"></span>.... <span class="_ _1"></span>39 </span></div><div class="t m0 x3 h5 yd ff1 fs3 fc0 sc0 lsb wsa">Verification .....................<span class="_ _0"></span>...............<span class="_ _0"></span>...................<span class="_ _0"></span>...................<span class="_ _0"></span>...............<span class="_ _0"></span>...................<span class="_ _0"></span>......<span class="_"> </span><span class="ls7 wsb">.....................<span class="_ _0"></span>... 42 </span></div><div class="t m0 x1 h5 ye ff4 fs2 fc0 sc0 lsc wsc">EXERCISE 2: DEPLOYING A WINDOWS AZURE APPLICAT<span class="_ _4"></span>ION <span class="_ _6"></span><span class="ls4 wsd">.................<span class="_ _0"></span>..................<span class="_ _0"></span>...................<span class="_ _0"></span>.... 44<span class="ff1 fs3 ls0 ws1"> </span></span></div><div class="t m0 x3 h5 yf ff1 fs3 fc0 sc0 ls7 ws6">Task 1 – Creating a Windows Azure Account <span class="_ _5"></span>..........................<span class="_ _0"></span>...............<span class="_ _0"></span>...................<span class="_ _0"></span>...............<span class="_ _0"></span>..........<span class="_ _4"></span><span class="lsd wse">. 44 </span></div><div class="t m0 x3 h5 y10 ff1 fs3 fc0 sc0 ls7 ws6">Task 2 – Creating a Storage Account and a Hosted Service Comp<span class="_ _4"></span>onent <span class="_ _7"></span>..............<span class="_ _0"></span>...................<span class="_ _0"></span>........... <span class="_ _7"></span>45 </div><div class="t m0 x3 h5 y11 ff1 fs3 fc0 sc0 ls9 ws8">Task 3 – Deploying the Application to the Windows Azure Developer Portal <span class="_ _5"></span>..............<span class="_ _0"></span>..................<span class="_ _0"></span>.... <span class="_ _1"></span>49 </div><div class="t m0 x3 h5 y12 ff1 fs3 fc0 sc0 ls7 ws6">Task 4 – Configuring the Application to Use the Storage Account <span class="_ _8"></span>...............<span class="_ _0"></span>...................<span class="_ _0"></span>...................<span class="_ _0"></span> <span class="_ _1"></span>51 </div><div class="t m0 x3 h5 y13 ff1 fs3 fc0 sc0 ls7 ws6">Task 5 – Testing the Application in the Staging Environment <span class="_ _4"></span>...................<span class="_ _0"></span>...............<span class="_ _0"></span>...................<span class="_ _0"></span>....... <span class="_ _1"></span>53 </div><div class="t m0 x3 h5 y14 ff1 fs3 fc0 sc0 ls7 ws6">Task 6 – Promoting the Application to Production <span class="_ _7"></span>.....................<span class="_ _0"></span>..................<span class="_ _0"></span>................<span class="_ _0"></span>..................<span class="_ _0"></span>.... <span class="_ _8"></span><span class="lse ws1">55 </span></div><div class="t m0 x1 h5 y15 ff4 fs2 fc0 sc0 ls4 wsf">SUMMARY ..............<span class="_ _0"></span>...................<span class="_ _0"></span>...................<span class="_ _0"></span>...................<span class="_ _0"></span>...................<span class="_ _0"></span>..................<span class="_ _0"></span>...........<span class="_ _0"></span><span class="wsd">............<span class="_ _0"></span>............... 56<span class="_ _0"></span><span class="ff1 fs3 ls0 ws1"> </span></span></div><div class="c x4 y16 w2 h6"><div class="t m0 x0 h7 y17 ff5 fs4 fc0 sc0 ls0 ws1">- 1 -</div></div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div>
</body>
</html>
<div id="pf2" class="pf w0 h0" data-page-no="2"><div class="pc pc2 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/627109a97b3701121450210f/bg2.jpg"><div class="t m0 x1 h8 y18 ff1 fs5 fc0 sc0 lsf ws1">Overview<span class="fs3 ls0"> </span></div><div class="t m0 x1 h5 y19 ff1 fs3 fc0 sc0 ls10 ws10">A service hosted in Windows Azure consists of one or <span class="ls7 ws6">more web role<span class="_ _4"></span>s and worker roles. A web role is an </span></div><div class="t m0 x1 h5 y1a ff1 fs3 fc0 sc0 ls11 ws11">ASP.NET Web application accessible via an HTTP or HTTPS endpoint a<span class="_ _0"></span>nd is commonly the front-end for </div><div class="t m0 x1 h5 y1b ff1 fs3 fc0 sc0 ls0 ws12">an application. Worker roles are backgro<span class="_ _4"></span>und-processin<span class="_ _4"></span>g applications and are typically found<span class="_ _4"></span> in the back-</div><div class="t m0 x1 h5 y1c ff1 fs3 fc0 sc0 ls10 ws10">end. Windows Azure services may be comprised of <span class="ls12 ws13">one or both types of roles and can run multiple </span></div><div class="t m0 x1 h5 y1d ff1 fs3 fc0 sc0 ls13 ws14">instances of each type. Role instances can be<span class="_ _4"></span> added or removed based on demand and allow </div><div class="t m0 x1 h5 y1e ff1 fs3 fc0 sc0 ls13 ws14">applications to quickly and economically <span class="ls14 ws15">scale-up or down when the need arises. </span></div><div class="t m0 x1 h5 y1f ff1 fs3 fc0 sc0 ls10 ws15">Windows Azure storage services provide storage in th<span class="ls12 ws13">e cloud, which includes blob services for storing </span></div><div class="t m0 x1 h5 y20 ff1 fs3 fc0 sc0 ls15 ws16">text and binary data, ta<span class="_ _0"></span>ble services for structure<span class="_ _0"></span>d storage that can be queried, and que<span class="_ _0"></span>ue services for </div><div class="t m0 x1 h5 y21 ff1 fs3 fc0 sc0 ls16 ws17">reliable and persiste<span class="_ _4"></span>nt messaging between services. </div><div class="t m0 x1 h5 y22 ff1 fs3 fc0 sc0 ls9 ws8">In this hands-on lab, you will explore the basic elements of a Windows Azure service by creating a simple </div><div class="t m0 x1 h5 y23 ff1 fs3 fc0 sc0 ls10 ws10">GuestBook application that demonstrates many features of the Windows Azure platform, including web </div><div class="t m0 x1 h5 y24 ff1 fs3 fc0 sc0 ls11 ws11">and worker roles, blob stora<span class="_ _0"></span>ge, table storage, and queues. </div><div class="t m0 x1 h5 y25 ff1 fs3 fc0 sc0 lsa ws18">In the GuestBook application, a web role pro<span class="_ _4"></span>vides th<span class="ls9 ws8">e front-end that allows users to view the contents </span></div><div class="t m0 x1 h5 y26 ff1 fs3 fc0 sc0 ls12 ws13">of the guest book and submit new entries. Each en<span class="ls9 ws8">try contains a name, a message, and an associated </span></div><div class="t m0 x1 h5 y27 ff1 fs3 fc0 sc0 ls17 ws19">pict<span class="_ _0"></span>ure. T<span class="_ _0"></span>he appl<span class="_ _0"></span>ica<span class="_ _0"></span>tion <span class="_ _0"></span>also c<span class="_ _0"></span>onta<span class="_ _0"></span>ins a<span class="_ _0"></span> worker<span class="_ _0"></span> role<span class="_ _0"></span> that c<span class="_ _0"></span>an g<span class="_ _0"></span>enera<span class="_ _0"></span>te thum<span class="_ _0"></span>bna<span class="_ _0"></span>ils f<span class="_ _0"></span>or the <span class="_ _0"></span>images<span class="_ _0"></span> tha<span class="_ _0"></span>t </div><div class="t m0 x1 h5 y28 ff1 fs3 fc0 sc0 ls18 ws1a">users submit. </div><div class="t m0 x1 h5 y29 ff1 fs3 fc0 sc0 ls19 ws1b">When users post a new item, the web role uploads th<span class="lsb ws1c">e picture to blob storage and creates a new ent<span class="_ _4"></span>ry </span></div><div class="t m0 x1 h5 y2a ff1 fs3 fc0 sc0 ls8 ws1d">in table storage. The entry contains the information entered by the user and a link to the blob with the </div><div class="t m0 x1 h5 y2b ff1 fs3 fc0 sc0 ls8 ws13">picture. The web role renders this information to the browser so users ca<span class="_ _0"></span>n view the contents of the </div><div class="t m0 x1 h5 y2c ff1 fs3 fc0 sc0 ls1a ws1e">guest book. </div><div class="t m0 x1 h5 y2d ff1 fs3 fc0 sc0 ls1b ws1f">After storing the image and creating the entry, the web role posts a work item to a queue to have the </div><div class="t m0 x1 h5 y2e ff1 fs3 fc0 sc0 ls1c ws20">ima<span class="_ _0"></span>ge pro<span class="_ _0"></span>cesse<span class="_ _0"></span>d. T<span class="_ _0"></span>he wor<span class="_ _0"></span>ker ro<span class="_ _0"></span>le f<span class="_ _0"></span>etche<span class="_ _0"></span>s the wo<span class="_ _0"></span>rk i<span class="_ _0"></span>t<span class="ls1b ws1f">em from the queue, retrieves the image from blob </span></div><div class="t m0 x1 h5 y2f ff1 fs3 fc0 sc0 ls1b ws10">storage, and resizes it to create a thumbnail. Using queues to post work items is a common pattern in </div><div class="t m0 x1 h5 y30 ff1 fs3 fc0 sc0 ls1d ws21">cloud applications and enables the sep<span class="_ _4"></span>aration of<span class="ls10 ws10"> compute-bound tasks from the front-end. The </span></div><div class="t m0 x1 h5 y31 ff1 fs3 fc0 sc0 ls7 ws6">advantage of this approach is that front an<span class="_ _4"></span><span class="ls1b ws1f">d back ends can be scaled independently. </span></div><div class="t m0 x1 h9 y32 ff6 fs6 fc2 sc0 ls1e ws1">Objectives </div><div class="t m0 x1 h5 y33 ff1 fs3 fc0 sc0 ls10 ws10">In this Hands-On Lab, you will learn how to: </div><div class="t m0 x5 h5 y34 ff1 fs3 fc0 sc0 ls12 ws13">Create applications in Windows Azure using web roles and worker roles </div><div class="t m0 x5 h5 y35 ff1 fs3 fc0 sc0 ls12 ws13">Use Windows Azure storage services including blobs, queues and tables<span class="_ _0"></span> </div><div class="c x6 y16 w2 h6"><div class="t m0 x0 h7 y17 ff5 fs4 fc0 sc0 ls0 ws1">- 2 -</div></div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div>
<div id="pf3" class="pf w0 h0" data-page-no="3"><div class="pc pc3 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/627109a97b3701121450210f/bg3.jpg"><div class="t m1 x5 ha y36 ff1 fs7 fc0 sc0 ls1f ws22">Deploy an application to Windows Azure </div><div class="t m2 x1 hb y37 ff6 fs8 fc2 sc0 ls20 ws1">Prerequisi<span class="_ _0"></span>tes </div><div class="t m1 x1 ha y38 ff1 fs7 fc0 sc0 ls21 ws23">The following is required to <span class="_ _0"></span>complete this hands-on lab: </div><div class="t m1 x5 ha y39 ff1 fs7 fc3 sc0 ls22 ws24">Microso<span class="_ _0"></span>ft .NET Framew<span class="_ _0"></span>ork 3.5 SP1</div><div class="t m1 x7 ha y3a ff1 fs7 fc0 sc0 ls0 ws1"> </div><div class="t m1 x5 ha y3b ff1 fs7 fc3 sc0 ls23 ws25">Microsoft Visual Stud<span class="_ _4"></span>io 2008 SP1 (or above<span class="_ _4"></span>)</div><div class="t m1 x8 ha y3c ff1 fs7 fc0 sc0 ls0 ws1"> </div><div class="t m1 x5 ha y3d ff1 fs7 fc3 sc0 ls24 ws26">Windows Azure Tools for Microsoft Visual Stud<span class="_ _4"></span>io (November 2009)</div><div class="t m1 x9 ha y3e ff1 fs7 fc0 sc0 ls0 ws1"> </div><div class="t m1 x5 ha y3f ff1 fs7 fc3 sc0 ls25 ws27">SQL Server<span class="_ _4"></span> 2005 Expr<span class="_ _4"></span>ess Edit<span class="_ _4"></span>ion (or above<span class="_ _4"></span>)</div><div class="t m1 xa ha y40 ff1 fs7 fc0 sc0 ls0 ws1"> </div><div class="t m1 x5 ha y41 ff1 fs7 fc0 sc0 ls26 ws28">IIS 7 (with ASP.NET, WCF HTTP Activation) </div><div class="t m2 x1 hb y42 ff6 fs8 fc2 sc0 ls27 ws1">Setup </div><div class="t m1 x1 ha y43 ff1 fs7 fc0 sc0 ls0 ws29">For convenien<span class="_ _4"></span>ce, much of the code used in this hand<span class="_ _4"></span><span class="ls28 ws2a">s-on lab is available as Visual Studio cod<span class="_ _4"></span>e snippets. </span></div><div class="t m1 x1 ha y44 ff1 fs7 fc0 sc0 ls29 ws2b">To check the prerequisites of the lab and ins<span class="_ _0"></span>tall the code snippets: </div><div class="t m1 x5 hc y45 ff1 fs7 fc0 sc0 ls1f ws2c">Run the <span class="ff7 ls2a ws1">Se<span class="_ _4"></span>tupLab<span class="_ _4"></span>.cmd<span class="_ _4"></span> </span><span class="ws22">script located in the lab's <span class="ff7 ls2b ws1">Source\Set<span class="_ _4"></span>up</span><span class="ls2c ws26"> folder<span class="_ _0"></span> to ch<span class="_ _0"></span>eck <span class="_ _0"></span>depen<span class="_ _0"></span>denci<span class="_ _0"></span>es and<span class="_ _0"></span> </span></span></div><div class="t m1 xb ha y46 ff1 fs7 fc0 sc0 ls2d ws2d">install any missing prerequisites. </div><div class="t m1 x5 ha y47 ff1 fs7 fc0 sc0 ls2d ws2d">Once you have verified every prerequisite, follow <span class="ls2e ws2e">the instructions to install the code snippets. </span></div><div class="t m2 x1 hb y48 ff6 fs8 fc2 sc0 ls2f ws2f">Using the Code Snippets </div><div class="t m1 x1 ha y49 ff1 fs7 fc0 sc0 ls28 ws2a">With code snippets, you have all the code<span class="_ _4"></span> you need<span class="ls30 ws30"> at your fingertips. The lab docu<span class="_ _4"></span>ment will tell you </span></div><div class="t m1 x1 ha y4a ff1 fs7 fc0 sc0 ls31 ws31">exac<span class="_ _0"></span>tly<span class="_ _0"></span> when y<span class="_ _0"></span>ou can<span class="_ _0"></span> use th<span class="_ _0"></span>em. F<span class="_ _0"></span>or exa<span class="_ _0"></span>mpl<span class="_ _0"></span>e, </div><div class="t m1 x7 ha y4b ff1 fs7 fc0 sc0 ls32 ws1"> </div><div class="t m1 x1 ha y4c ff1 fs7 fc0 sc0 ls33 ws32">To add this code snippet in Visual Studio, you simply place the cursor wher<span class="_ _0"></span>e you would like the code to </div><div class="t m1 x1 ha y4d ff1 fs7 fc0 sc0 ls34 ws33">be inserted, sta<span class="_ _0"></span>rt typing the snippet name (without <span class="_ _0"></span>spaces or hyphens), in this <span class="_ _0"></span>case </div><div class="t m1 x1 ha y4e ff8 fs7 fc0 sc0 ls24 ws1">LabNameEx01RunmethodCS<span class="ff1 ls35 ws34">, watch as Intellisense picks up the snippet name, and then hit the TAB key </span></div><div class="t m1 x1 ha y4f ff1 fs7 fc0 sc0 ls24 ws35">twice once the snippet you want is selected. The <span class="ls36 ws36">code will be inserted <span class="ls37 ws37">at the<span class="_ _4"></span> cursor location. </span></span></div><div class="c x4 y16 w2 h6"><div class="t m0 x0 h7 y17 ff5 fs4 fc0 sc0 ls0 ws1">- 3 -</div></div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div>
<div id="pf4" class="pf w0 h0" data-page-no="4"><div class="pc pc4 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/627109a97b3701121450210f/bg4.jpg"><div class="t m0 xc h5 y50 ff1 fs3 fc0 sc0 ls0 ws1"> </div><div class="t m0 x1 hd y51 ff7 fs3 fc0 sc0 ls9 ws8">Figure 1 </div><div class="t m0 x1 h5 y52 ff8 fs3 fc0 sc0 ls38 ws38">Hit TAB t<span class="_ _4"></span>o select<span class="_ _4"></span> the high<span class="_ _4"></span>lighted sn<span class="_ _4"></span>ippet. </div><div class="t m0 x1 h5 y53 ff1 fs3 fc0 sc0 ls0 ws1"> </div><div class="t m0 xc h5 y54 ff1 fs3 fc0 sc0 ls0 ws1"> </div><div class="t m0 x1 hd y55 ff7 fs3 fc0 sc0 ls9 ws8">Figure 2 </div><div class="t m0 x1 h5 y56 ff8 fs3 fc0 sc0 ls13 ws8">Hit TAB again and the snippet will expan<span class="_ _4"></span>d </div><div class="t m0 x1 h5 y57 ff1 fs3 fc0 sc0 ls1b ws1f">To insert a code snippet using the mouse rather than<span class="lsa ws18"> the<span class="_ _4"></span> keyboard, right-click where you want the code </span></div><div class="t m0 x1 hd y58 ff1 fs3 fc0 sc0 ls36 ws39">snippet to be inserted, select <span class="_ _4"></span><span class="ff7 ls39 ws3a">Insert Snippe<span class="_ _4"></span>t </span><span class="ls3a ws3b">followed by <span class="ff7 ls3b ws3c">My Code Snip<span class="_ _4"></span>pets </span><span class="ls9 ws8">and then pick the relevant </span></span></div><div class="t m0 x1 h5 y59 ff1 fs3 fc0 sc0 lsa ws18">snippet from the list. </div><div class="t m0 x1 h5 y5a ff1 fs3 fc0 sc0 ls1b ws1f">To learn more about Visual Studio IntelliSense Code Sn<span class="ws10">ippets, including how to create your own, please </span></div><div class="t m0 x1 h5 y5b ff1 fs3 fc0 sc0 ls3c ws1">see <span class="fc3 ls16 ws17">Creating and Using IntelliSense Code Snippets</span></div><div class="t m0 xd h5 y5c ff1 fs3 fc0 sc0 lsa ws18">. </div><div class="t m0 x1 h9 y5d ff6 fs6 fc2 sc0 ls3d ws1">Exercises </div><div class="t m0 x1 h5 y5e ff1 fs3 fc0 sc0 ls12 ws13">This Hands-On Lab comprises the following exercises: </div><div class="t m0 x5 h5 y5f ff1 fs3 fc0 sc0 ls3e ws3d">Buil<span class="_ _0"></span>ding<span class="_ _0"></span> You<span class="_ _0"></span>r Fi<span class="_ _0"></span>rst W<span class="_ _0"></span>indo<span class="_ _0"></span>ws Az<span class="_ _0"></span>ure A<span class="_ _0"></span>ppli<span class="_ _0"></span>ca<span class="_ _0"></span>tion </div><div class="t m0 x5 h5 y60 ff1 fs3 fc0 sc0 ls7 ws6">Deploying a Windows Azure Application </div><div class="t m0 x1 hd y61 ff1 fs3 fc0 sc0 lsb ws1c">Estimated time to complete this lab: <span class="_ _4"></span><span class="ff7 ws18">60 minutes</span><span class="ws1">. </span></div><div class="t m0 x1 he y62 ff9 fs9 fc4 sc0 ls3f ws1">Ex<span class="_ _8"></span>er<span class="_ _0"></span>cise 1: Building Y<span class="_ _5"></span>our First Windows </div><div class="t m0 x1 he y63 ff9 fs9 fc4 sc0 ls40 ws1">Azur<span class="_ _0"></span>e Application </div><div class="t m0 x1 h5 y64 ff1 fs3 fc0 sc0 ls10 ws10">In this exercise, you create a guest book application and execute it in the local development fabric. For </div><div class="t m0 x1 h5 y65 ff1 fs3 fc0 sc0 ls41 ws3e">this <span class="_ _0"></span>purpo<span class="_ _0"></span>se,<span class="_ _0"></span> you wil<span class="_ _0"></span>l us<span class="_ _0"></span>e the W<span class="_ _0"></span>indo<span class="_ _0"></span>ws Azu<span class="_ _0"></span>re Too<span class="_ _0"></span>ls f<span class="_ _0"></span>or Mi<span class="_ _0"></span>cros<span class="_ _0"></span>oft Vi<span class="_ _0"></span>sual<span class="_ _0"></span> Studi<span class="_ _0"></span>o to c<span class="_ _0"></span>reat<span class="_ _0"></span>e the<span class="_ _0"></span> proj<span class="_ _0"></span>ect </div><div class="t m0 x1 h5 y66 ff1 fs3 fc0 sc0 ls8 ws1d">using the Cloud Service project template. These tools extend Visual Studio 2008 to enable the creation, </div><div class="c x6 y16 w2 h6"><div class="t m0 x0 h7 y17 ff5 fs4 fc0 sc0 ls0 ws1">- 4 -</div></div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div>
<div id="pf5" class="pf w0 h0" data-page-no="5"><div class="pc pc5 w0 h0"><img class="bi x0 y0 w1 h1" alt="" src="https://static.pudn.com/prod/directory_preview_static/627109a97b3701121450210f/bg5.jpg"><div class="t m0 x1 h5 y36 ff1 fs3 fc0 sc0 ls42 ws3f">building and running of Windows Azure serv<span class="_ _0"></span>ices. You wi<span class="ls43 ws3e">ll continue to work with this project throughout </span></div><div class="t m0 x1 h5 y67 ff1 fs3 fc0 sc0 ls42 ws3f">the remainder of the lab. </div><div class="t m0 xe hd y68 ff7 fs3 fc0 sc0 ls44 ws1">Note<span class="_ _4"></span>:<span class="ff1 ls45 ws40"> To reduc<span class="_ _0"></span>e ty<span class="_ _0"></span>ping<span class="_ _0"></span>, you c<span class="_ _0"></span>an r<span class="_ _0"></span>ight<span class="_ _0"></span>-cl<span class="_ _0"></span>ick w<span class="_ _0"></span>here y<span class="_ _0"></span>ou wa<span class="_ _0"></span>nt to i<span class="_ _0"></span>nser<span class="_ _0"></span>t so<span class="_ _0"></span>urce<span class="_ _0"></span> code,<span class="_ _0"></span> sel<span class="_ _0"></span>ect I<span class="_ _0"></span>nsert </span></div><div class="t m0 xe h5 y69 ff1 fs3 fc0 sc0 ls46 ws41">Snippet, se<span class="_ _4"></span>lect My Code Sn<span class="_ _4"></span>ippets and th<span class="_ _4"></span>en sele<span class="_ _4"></span>ct<span class="ls14 ws15"> the entry matching the current exercise step. </span></div><div class="t m0 x1 hd y6a ff7 fs3 fc0 sc0 ls47 ws42">Task 1 – Creating the Visu<span class="_ _0"></span>al Studio Project </div><div class="t m0 x1 h5 y6b ff1 fs3 fc0 sc0 ls10 ws10">In this task, you create a new Cloud Service project in Visual Studio. </div><div class="t m0 x5 hd y6c ff1 fs3 fc0 sc0 ls48 ws43">Open Microsoft Visual Studio 20<span class="_ _4"></span>08 elevated as<span class="ff7 ls7 ws6"> Ad<span class="_ _4"></span>ministrator</span><span class="ls49 ws44">, from <span class="ff7 ls16 ws1">Start</span><span class="ls4a ws45"> | <span class="ff7 ls11 ws46">All Programs</span><span class="ls4b ws47"> | </span></span></span></div><div class="t m0 xb hd y6d ff7 fs3 fc0 sc0 ls4b ws47">Microsoft Visual Stud<span class="_ _4"></span>io 2008<span class="ff1 ls43 ws48">, right-click </span><span class="ls12 ws13">Mi<span class="_ _0"></span>crosoft Visual Studio 2008<span class="ff1 ls4c ws49"> and c<span class="_ _4"></span>hoos<span class="_ _4"></span>e </span><span class="ls42 ws3f">Run as </span></span></div><div class="t m0 xb hd y6e ff7 fs3 fc0 sc0 lsa ws1">Administrator<span class="ff1 ls3a ws3b">. If the </span><span class="ls4d ws4a">User Account Control<span class="ff1 ls4e ws4b"> d<span class="_ _4"></span>ialog<span class="_ _4"></span> appe<span class="_ _4"></span>ars, c<span class="_ _4"></span>lick<span class="_ _4"></span> </span></span><span class="ls4f">Continue<span class="ff1 ls50">. </span></span></div><div class="t m0 x5 hd y6f ff1 fs3 fc0 sc0 ls1b ws1f">From the <span class="ff7 ls47 ws1">File</span><span class="ls4b ws47"> menu, choose <span class="ff7 ls44 ws1">Ne<span class="_ _4"></span>w</span><span class="ls50 ws4c"> an<span class="_ _4"></span>d the<span class="_ _4"></span>n <span class="ff7 ls51 ws1">Project</span>. </span></span></div><div class="t m0 x5 hd y70 ff1 fs3 fc0 sc0 ls42 ws3f">In the <span class="ff7 ls4d ws4d">New Project</span><span class="ls12 ws13"> dialog, expand the language of your preference (Visual C# or Visual Basic) in t<span class="_ _0"></span>he </span></div><div class="t m0 xb hd y71 ff7 fs3 fc0 sc0 ls10 ws10">Project types<span class="ff1 ls12 ws13"> list and select </span><span class="ls1d ws21">Cloud Service<span class="ff1 lsa ws1">. </span></span></div><div class="t m0 x5 hd y72 ff1 fs3 fc0 sc0 ls42 ws3f">In the <span class="ff7 ls52 ws1">Temp<span class="_ _4"></span>lates<span class="_ _4"></span></span><span class="lsa ws18"> list, select <span class="ff7 ls43 ws48">Windows Azure</span><span class="ls0 ws1"> <span class="ff7 ls53 ws3d">Cloud Service</span><span class="ls12 ws13">. E<span class="_ _0"></span>nter the name “<span class="ff7 ws1">GuestBook</span><span class="ls54 ws4e">” and the<span class="_ _4"></span> </span></span></span></span></div><div class="t m0 xb hd y73 ff1 fs3 fc0 sc0 lsa ws18">solution name “<span class="ff7 ls12 ws1">Begin</span><span class="ls11 ws11">”, then set the location to the folder for the l<span class="_ _0"></span>anguage of your preference </span></div><div class="t m0 xb hd y74 ff1 fs3 fc0 sc0 ls3a ws3b">(Visual C# or Visual Basic) inside <span class="ff7 ls11 ws1">Ex01-BuildingYourFirstWindowsAzureApp</span><span class="ls55 ws15"> in the<span class="_ _4"></span> <span class="ff7 ws1">Sour<span class="_ _4"></span>ce</span><span class="ls56 ws4f"> folder </span></span></div><div class="t m0 xb hd y75 ff1 fs3 fc0 sc0 ls14 ws50">of the lab. Ensure <span class="_ _4"></span><span class="ff7 ls49 ws44">Create direct<span class="_ _4"></span>ory for solution<span class="_ _4"></span></span><span class="ls1b ws1f"> is checked and click <span class="ff7 ls46 ws1">OK</span><span class="ls12 ws13"> to create the project. </span></span></div><div class="t m0 xa h5 y76 ff1 fs3 fc0 sc0 ls57 ws1"> </div><div class="t m0 xf hd y77 ff7 fs3 fc0 sc0 ls58 ws51">Figure 3<span class="_ _4"></span> </div><div class="t m0 xf h5 y78 ff8 fs3 fc0 sc0 ls15 ws16">Creating a new Windows Azure Cloud Serv<span class="_ _0"></span>ice project </div><div class="t m0 x5 hd y79 ff1 fs3 fc0 sc0 ls42 ws16">In the <span class="ff7 ls15">New Cloud Service Project</span><span class="ls12 ws13"> dial<span class="_ _0"></span>og, inside the <span class="ff7 ls59 ws1">Roles</span><span class="ls1a ws1e"> panel, expand the tab for the languag<span class="_ _0"></span>e of </span></span></div><div class="t m0 xb hd y7a ff1 fs3 fc0 sc0 ls59 ws52">your choice (Visu<span class="_ _4"></span>al C# or Visual Basic), select <span class="_ _4"></span><span class="ff7 ls12 ws53">ASP.NET Web Role </span><span class="ls43 ws48">from the list of available roles </span></div><div class="t m0 xb h5 y7b ff1 fs3 fc0 sc0 ls9 ws8">and click the arrow (>) to add an instance of this role to the solution<span class="_ _4"></span>. Before closing the dialog, </div><div class="t m0 xb h5 y7c ff1 fs3 fc0 sc0 lsa ws18">select the new role in the<span class="_ _4"></span> right panel, click the pencil icon and rename the role as </div><div class="t m0 xb hd y7d ff7 fs3 fc0 sc0 ls42 ws1">GuestBook_WebRole<span class="ff1 lsb ws1c">. Click </span><span class="ls5a">OK<span class="ff1 ls43 ws48"> to <span class="_ _0"></span>create the cloud service solution. </span></span></div><div class="c x4 y16 w2 h6"><div class="t m0 x0 h7 y17 ff5 fs4 fc0 sc0 ls0 ws1">- 5 -</div></div></div><div class="pi" data-data='{"ctm":[1.611639,0.000000,0.000000,1.611639,0.000000,0.000000]}'></div></div>