Windows Azure Guestbook Demo



Demo ScriptBuilding and Deploying a ServiceLab version:1.0.0Last updated: DATE \@ "M/d/yyyy" 12/3/2009Prepared by:David AikenContents TOC \h \z \t "Heading 3,2,pp Topic,1,PP Procedure start,3" Overview PAGEREF _Toc247626078 \h 3Key Messages PAGEREF _Toc247626079 \h 3Key Technologies PAGEREF _Toc247626080 \h 3Time Estimates PAGEREF _Toc247626081 \h 4Setup and Configuration PAGEREF _Toc247626082 \h 4Task 1 –Run the dependency checker PAGEREF _Toc247626083 \h 4Demo Flow PAGEREF _Toc247626084 \h 5Opening Statement PAGEREF _Toc247626085 \h 6Step-by-Step Walkthrough PAGEREF _Toc247626086 \h 6Previewing the Guestbook solution on the local developer fabric PAGEREF _Toc247626087 \h 6Deploying the application PAGEREF _Toc247626088 \h 10Summary PAGEREF _Toc247626089 \h 21Known Issues PAGEREF _Toc247626090 \h 21 OverviewThis document provides setup documentation, step-by-step instructions, and a written script for showing a demo of Windows Azure. This document can also serve as a tutorial or walkthrough of the technology. In this demo you will build, debug, and deploy an Application using Windows Azure and have the application running on the web in less than 5 minutes. For additional demos of the Windows Azure Platform, please visit . Note: In order to run through this complete demo, you must have network connectivity and a Windows Azure developer account. To create a developer account, you need to sign-up for an invitation code and redeem the invitation code on the Azure Services Developer Portal located at: Key MessagesIn this demo you will see three key things:First you will see how the Windows Azure SDK and Visual Studio Tools for Windows Azure provide development tools that enable a rich and familiar development experience for cloud applications.Second you will see how Windows Azure abstracts you from the underlying infrascture and uses simple models to define the roles and number of instances for your application. Finally, you will see how to deploy, start, and manage a Windows Azure application through the Azure services Developer portal.Key TechnologiesThis demo uses the following technologies:.NET Framework 3.5 SP1Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1Windows Azure Tools for Microsoft Visual Studio November CTP or laterTime EstimatesEstimated time for setting up and configuring the demo: 10 minEstimated time to complete the demo: 10 minSetup and ConfigurationThis demo does not have any advanced configuration requirements. You simply need to have the pre-requisites installed and have a developer account for Windows Azure. Task 1 –Run the dependency checkerThe following steps describe how to run the Dependency Checker utility included with the lab to verify that you have the pre-requisite components properly installed. You can skip this exercise if you are confident that the pre-requisites are properly installed and configured. Run the StartHere.cmd command script located in the directory that contains this demo. The StartHere.cmd script will launch the Configuration Wizard. The Configuration Wizard is designed to check your machine to ensure that it is properly configured with all of the dependencies to build and run the demo.Click through the steps in the Configuration Wizard. The Required Software step will perform the actual scan of your machine. If you do not have the necessary dependencies, then install them using the links provided by the dependency checker and rescan your machine. Demo FlowThe following diagram illustrates the high-level flow for this demo and the steps involved:Opening StatementIn the next 10 minutes, we will deploy a simple Application to Windows Azure. I want to show you a simple demo, so you can get a feel for the concepts and steps involved with building a Windows Azure application using the November CTP. In later demos, we’ll look at how the application was put together.In this demo you will specifically see three key things:First you will see how the Windows Azure SDK and Visual Studio Tools for Windows Azure provide development tools that enable a rich and familiar development experience for cloud applications.Second you will see how Windows Azure abstracts you from the underlying infrascture and uses simple models to define the roles and number of instances for your application. Finally, you will see how to deploy, start, and manage a Windows Azure application through the Developer portal.Step-by-Step WalkthroughThis demo is composed of the following segments:Previewing the Guestbook solution on the local developer fabricDeploying the applicationPreviewing the Guestbook solution on the local developer fabricActionScriptScreenshotStart Visual Studio 2008 or Visual Web Developer 2008 SP1Select File -> Open ProjectSelect GuestBook.slnLet’s Open an existing Windows Azure project.In the following demos we are going to use the Guestbook application.The Guestbook application is a simple application that exercises many features of the Windows Azure platform.Once the solution is open, point out the projects:GuestBook_Data contains the classes for the data entities used by table storageGuestBook is the cloud project. This is what defines the structure of the cloud solution, which roles are present and any service configuration.GuestBook_WebRole is the project for the web role.GuestBook_WorkerRole is the worker role, written in VB.As you can see we have several projectsMost of the projects are simply either standard class libraries, or web sites.The important project for us is GuestBookThis defines the structure of our service.You can see it has 2 roles, GuestBook_WebRole provides the web role, and GuestBook_WorkerRole provides the worker role.It also contains a configuration file that defines the model for our Windows Azure solution. We’ll take a look at this model in just a few minutes when we deploy the service.Select Debug->Start DebuggingNow let’s see what the guestbook service does before we deploy it to the cloud.We can start the application in debug mode or just press the familiar F5 button.NOTE: It will take 30-90 seconds until the devfabric starts.Once the devfabric starts, expand the GuestBook application in the devfabric.NOTE: to show the dev fabric UI, you will have to right click the dev fabric tray icon and choose Show Developerment Fabric UIThis will cause the project to be compiled into a .NET assembly, just as normal. However, since we have a Cloud Service project in our solution, this will then start the Windows Azure Development Fabric.The Development Fabric, or simple devfabric, is a simulated environment for developing and testing Windows Azure applications on your machine.You can think of this as a Cassini like environmentHere you can see the Development Fabric UI. Notice that we have a new deployment containing our GuestBook applicationIf we expand the GuestBook1 application we can see that there are both a WebRole and WorkerSwitch over to Internet Explorer to show the applicationComplete the fields, and choose an image to upload. Its good to choose a large hi-res image, because the guestbook service will resize it!Click on the pencil icon.Here we can see our simple web applicationLets add an entry.Once we click the pencil icon, the details are added to a table, and the photo is uploaded to blob storage.There is a update panel on the page, which will refresh every 5 seconds and display any new messages.At first the image will appear the same size as I uploaded itBut after a few seconds it will be resized.What happened is when the image was uploaded a message with the location of the image was placed in a Queue, which was later read by the Worker Role.The Worker role then resized the image to the correct size.We’ll see how this is done in later demosStop the application by closing Internet ExplorerDeploying the applicationActionScriptScreenshotSwitch back to Visual StudioRight click on the GuestBook project and select Publish from the context menuNow let’s deploy our GuestBook application to the cloudLet’s switch back to Visual StudioTo deploy our app, first let’s right click on the GuestBook Cloud Service project and select PublishThis will compile and build the solution. It will also create a new service package, essentially a zip file, containing the assemblies and configuration files for the solution. Switch over to the browser window that was launched during the Publish processNow let’s login to the Azure Services management portal using our Live ID.Previously, I have created a developer account in the Azure Services developer portal and I have redeemed an invitation code for Windows Azure. This invitation code gives me the ability to deploy new applications to Windows Azure or use Windows Azure Storage Services.Select the PDC08 CTP Project.Here you can see the developer portal that includes all the Windows Azure platform services linked to the navigation tab on the left here.We need to select our PDC projectClick on the New Service linkHere you can see the developer portal and the projects that I have already configured. Let’s create a new Storage Account.This Storage account will be used to storage the table and image data from the guestbook.Click on the Storage Account project typeEnter the name of the storage project, name it <yournamegbstore>Click NextLets call the storage demos storageEnter the same name as aboveClick Check Availability. You should get a <yournamegbstore> is available. If not, choose a different name.Create a new Affinity Group called Guestbook so that later we can associate the compute in the same location. Click CreateNext we’ll specify the storage name. This will be the dns name for the storage endpoints. This must be unique, so that is why I’m using my name.Clicking Check Availability will confirm no-one else has used that name.Next, we will select our datacenter as anywhere, but create a new affinity group. We will use this later to make sure our data and web site are co-located.Then we can create the storage accountDo NOTHING, but keep this open in the web browser.Once the account is create we can view the storage endpoints as well as the shared keys required to access storage.There are also options to change the keys, and delete the project.Now that we have the storage account created, we have to update the configuration for the service we are about to deploy, so it uses the storage in the cloud, rather than the local developer storage.Open the ServiceConfiguation.cscfg in notepad.Locate the 2 sections that are currently commented out. Put comments around the devstore account entries, or delete themCopy the account name into the placeholder provided.Copy the Primary Access Key into the placeholder providedRepeat this for the worker role section of the serviceconfiguration.csfg file.Flipping back to the folder with the 2 files, we can open the serviceconfiguration.cscfg file and enter the new storage detailsAll we need to do is to remove the configuration we had defined for the locat store,And copy the settings from the web pageAs a alternative, you can edit the original file in Visual Studio, then re-publish. Once you have the settings in the configuration file, you can also execute the service again, and use the service against the cloud storage. This is cool when you have time as once the app is deployed people will still see the original picture. You can also have people sign the guestbook in the cloud – and see those updates during the remaining sessions.Click on the New Service linkClick on Hosted Service.Now we have the storage account and configuration updated, we can deploy the service to the cloudWe’ll create another new project, but this time it will be a hosted service.Give the project a name <yournamegb>Press the Next button.Next let’s give our project a name.Enter a sub-domain name such as <yournamegb> and press the Check Availability button.Continue this process until you find an available sub-domain.Select the “Use Existing Affinity Group” option and select the Guestbook affinity group created earlier.Press the Create button to create the new project.On the next step we can specify a sub-domain for the application.Let’s enter a sub-domain name and check the availability.Next, we want to select our same affinity group we created earlier to ensure that our data and site are co-located.Finally, let’s create the project in the Azure Services Developer Portal.Click on the Deploy button below Staging.You can now see your new project in the developer portal. Notice that with a Windows Azure project, there are two environments: Production and Staging.Now let’s deploy our application into the staging environment.Browse to the directory where you published the solution. For the App Package, browse or enter the full path to the GuestBook.cspkg file.For the configuration file, browse or enter the full path to the ServiceConfiguration.cscfg file located in the same directory.Enter a label for the deployment, such as beta1Click the Deploy buttonOn the next page we can browse to the service package that we published from Visual StudioWe also need to browse to the ServiceConfiguration file that was also published from Visual Studio. You might recall that this file defines the roles and number of instances per role.Finally, we’ll give the deployment a label and start the deployment.Wait for the service package to be uploaded. Once it is uploaded, you will be redirected to the project details page.At this point, the service package will be uploaded to the Azure Services Developer PortalWait until the package is has been deployed.Once the package has been uploaded, the assemblies, ASPX pages, and configuration files will be extracted. This can take a few minutes.Click the Run button to start the GuestBook application.NOTE: This process will take anywhere from 3 – 10 minutes.If you are presenting, you may wish to continue the presentation ,then return to this demo laterOnce the package is deployed, we can then start the GuestBook application. When we click the Run button, this is when the real magic happens.At this point Windows Azure will start up virtual machine instances for each of the roles. Once the instances are started, then our application – the assemblies, ASPX pages, etc. that we uploaded earlier – will be deployed into each of the instances. This process will take a few mintues. Click on the Web Site URL for the Staging environment. Once the application is running in staging, we can now access it using the temporary Website URL generated below.View the GuestBook web site in the new browser windowClose the browser window.Here we can see our GuestBook application running in Windows Azure – it’s publicly exposed on the web!In fact, you could even access it now if you could enter this long, temporary web site URL.Click on the SWAP button between the Production and Staging environmentsYou will be prompted to confirm that you want to switch to the production environment. Press the OK button when prompted.NOTE: This can take a few minutes to start the production environment.Let’s close this window and go back to the Azure Services Developer Portal.Let’s see how we can move our application from staging to production. We’ll click on the swap button and confirm that we want to move the switch the staging environment with production. This can take a few minutes.You should now see that the production environment is running.Click on the Website URL below the Production environment.NOTE: It may take a few minutes for the DNS entries to be updated.You can now see that the production environment is running.Let’s now browse to our application running in production.You should see the web page with any guestbook entries.Finally, you can see that our simple, GuestBook application is running in the production environment. Notice that the URL is the sub-domain on that we specified when creating the project in the Azure Services Developer Portal. If you have internet access you can browse to this site now. SummaryIn this demo, you saw how we can easily build & deploy applications using the familiar programming model and the new Windows Azure SDK and extensions to Visual Studio. You also saw how we can use the Azure Services Portal to create projects, deploy applications, and manage the staging and production environments. Finally, in less than 5 minutes we created and ran a new application in the cloud.What you did not see is all of the infrastructure Windows Azure provided. For example, we didn’t worry about physical machines, rack space, network switches or connectivity. We also didn’t have to remote into machines and physically copy files across machines. Windows Azure abstracted us from the underlying infrastructure and provided the automated deployment, isolation, redundancy, and load balancing for our application. This was intentionally a simple demo to help you understand the concepts. In later demos you will see how we can build more complex applications that utilize additional roles, the Windows Azure APIs, and Windows Azure Storage services. Known IssuesPlease note the following known issues with this demo:It can sometimes take several minutes to start a Windows Azure application in the cloud. Consequently, you may want to have an example application already deployed and running in the production environment. With the current CTP version of Windows Azure you are limited to two instances of a role. If you configure a role to use more than two instances, you can run it in the development fabric. However, if you attempt to deploy the application using more than two instances to the cloud, you will receive an error during deployment. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download