WEBSITE

Deploying an ASP.NET Application in Windows Azure

2/11/2011 11:47:58 AM
You're almost there. In this section, you walk through the steps of deploying the ASP.NET application in the cloud:
  1. You need to publish your project. Right-click AzureExample, and click Publish. This action, upon success, opens two windows:

    • Windows Explorer. This window contains the two files you need to deploy in Windows Azure. You need this window soon, so don't close it.

    • Internet Explorer. The Windows Azure Portal is automatically shown as well, because you need to deploy the binaries there. You may be prompted to sign in first.

  2. When you've logged in, the Internet Explorer window shows you the home page for your Windows Azure projects. Click the Windows Azure project under which you previously created the AzureExample service.

  3. You should see the page shown in Figure 1 at this article. Click AzureExample, which should bring you to what you saw earlier in Figure 4.

  4. On the right side of the browser page is a vertical bar with a left-pointing triangle. Click the triangle to open a split page with both Production and Staging sections, as shown in Figure 1. Deploying in staging creates a temporary service that you can use to test before promoting to the final public URL. This way, you can test that your application is working as desired before deploying it.

    Figure 1. Viewing the production and staging environments
  5. Click the Deploy button under Staging. Doing so brings up a new page (see Figure 9-16) with the following fields:

    • Application Package. This is the package that Visual Studio built for you. It's the file with extension .cspkg in the Windows Explorer window. Clicking Browse opens an Open form. You may find it easier to copy the entire path from the Windows Explorer window and paste it in the Open form. Select the package file, and click Open.

    • Configuration Settings. This is the configuration file of your cloud service project with a .cscfg extension. Again, click Browse and select the configuration file from the Open form.

    • Operating System Settings. This section allows you to configure the specific version of the operating system you're using for this service. Leaving Upgrade Method set to Automatic ensures that you get the latest security patches and .NET upgrades automatically. You can also choose Manual and select the desired system.

    • Service Deployment Name. Under Service Deployment Name, you need to enter a label for your service. Type TEST001, for example.

    Figure 2. Windows Azure first-time deployment page
  6. When the information provided looks like Figure 2, click Deploy. Doing so first copies the appropriate files to the cloud and creates the virtual machine in which your project will be deployed (see Figure 3). After it's deployed, your service isn't be running just yet; however, you start incurring charges immediately.

    Figure 3. Deploying a package in staging

Your screen should now look like Figure 4. To start your virtual machine, click Run under Staging. This operation may take a few minutes. When the startup operation is completed, you see the status of your service as Ready. At this point, you can test your ASP.NET application in the cloud by clicking the Web Site URL link in Staging. Notice that this isn't the URL you originally requested—the public URL previously registered is reserved for production. Instead, staging is given a deployment GUID that's also part of the web site's URL. In this case, the URL for the staging environment is http://de2d988c570d4c36b43a72686391d4b5.cloudapp.net/

Figure 4. Completed deployment of your service

Clicking the link opens another browser and runs your service in the cloud (see Figure 5).

Figure 5. Running the service in the cloud

NOTE

As mentioned previously, you're now paying for this Windows Azure service. You must first suspend your service (by clicking Suspend) if it's running; however, that alone doesn't stop you from accruing charges. You must also click the Delete button under both your staging and production environments. On the same page is a Delete Service button; it releases your service altogether and doesn't affect how you're billed.

Now that the code has been tested in staging, go back to the service management page (shown earlier in Figure 4) and click the center icon () to promote your code to production. A confirmation message comes up. This operation swaps both environments (production and staging); you can expect to wait a few minutes while the swapping takes place. Once in production, the URL you registered previously works.

You may have noticed that you haven't changed any database settings between staging and production. Staging and production environments refer only to Windows Azure services, not the SQL Azure database running behind the scenes.

As a result all versions of your ASP.NET application (when run locally, in staging or in production) point to the same SQL Azure database by default, unless you specifically change your configuration settings in each environment (see Figure 6). You also need to make sure your firewall configuration is correctly set, or you may have a surprise when publishing your web application in the cloud.

Figure 6. Summary of deployment scenarios


Other  
  •  Windows Azure and ASP.NET : Creating a Windows Azure Project
  •  Windows Azure and ASP.NET : Creating a Windows Azure Service
  •  IIS 7.0 : Performance and Tuning - Processor
  •  IIS 7.0 : Striking a Balance Between Security and Performance - SSL
  •  IIS 7.0 : Striking a Balance Between Security and Performance - How to Measure Overhead
  •  Advanced ASP.NET : Component-Based Programming - The ObjectDataSource
  •  Advanced ASP.NET : Data-Access Components (part 3) - Enhancing the Component with Error Handling & Enhancing the Component with Aggregate Information
  •  Advanced ASP.NET : Data-Access Components (part 2) - Using the Data-Access Component
  •  Advanced ASP.NET : Data-Access Components (part 1) - A Simple Data-Access Component
  •  Advanced ASP.NET : Component-Based Programming - Properties and State
  •  Advanced ASP.NET : Creating a Component
  •  IIS 7.0 : Troubleshooting - Using Tools and Utilities
  •  IIS 7.0 : Tracing and Troubleshooting - Reading the FRT Logs
  •  The ASP.NET AJAX Control Toolkit (part 3) - The AutoCompleteExtender
  •  The ASP.NET AJAX Control Toolkit (part 2) - The Accordion
  •  The ASP.NET AJAX Control Toolkit (part 1) - Installing
  •  IIS 7.0 : Enabling and Configuring FRT - Configuring FRT by Using Appcmd
  •  IIS 7.0 : Enabling and Configuring FRT - Tracing a Specific Error Code
  •  Joomla! Blogging and RSS Feeds : Using separate blog components
  •  Optimizing for Vertical Search : Optimizing for News, Blog, and Feed Search
  •  
    Top 10
    A Look At Truecrypt The Open Source Security Tool
    Price Of Piracy
    Acer Aspire 5600U 23" Touchscreen All-in-One PC
    Zalman FX100-Cube Fanless Cooler
    Devolo dLAN LiveCam Starter Kit
    Has Apple Lost It? (Part 2)
    Has Apple Lost It? (Part 1)
    Sony Computer Entertainment (Part 3)
    Sony Computer Entertainment (Part 2)
    Sony Computer Entertainment (Part 1)
    Most View
    AMD A6-3500 - Llano integrated-graphics processors
    Samsung launched projector, smartphone, and 10.1'' note device
    Working with Access and Connectivity Policies in Vista
    Getting the Most Out of the Microsoft Outlook Client : Using Outlook 2007 (part 2) - Sharing Information with Users Outside the Company
    iPhone Application Development : Making Multivalue Choices with Pickers - Understanding Pickers
    Managing Windows Firewall in Windows Vista
    What To Look For When Buying A New Phone Or Tablet (Part 10)
    Delete & Recover Data (Part 4) - Securely Deleting Data Using Eraser 6.0
    The New Domain Names (Part 2)
    Windows Server 2008 : Domain Name System and IPv6 - DNS in Windows Server 2008 R2
    Customizing the Taskbar in Vista
    Kindle Fire HD - Most Advanced 7" Tablet (Part 2)
    Remote Administration of Exchange Server 2010 Servers : RDP with Exchange Server 2010 (part 1) - Planning and Using Remote Desktop for Administration
    Exchange Server 2010 server roles (part 1) - Mailbox Server role
    Nuforce Air DAC Review
    SQL Server 2005 Native XML Web Services : Exposing SQL Programmability as Web Services (part 1)
    SQL Server 2008 : Working with Multiple-Source Queries - Using Linked Servers
    Nintendo WII U - Modern HD Gaming Console (Part 5)
    SQL Server 2008 R2 : Creating and Managing Indexes - Creating Indexes (part 2) - Creating Indexes with SSMS
    Adobe InDesign CS5 : Importing Graphic Objects (part 3) - Using the Image Import Options Dialog Box