Chapter III Design of design program architecture implement Windows Azure role lifecycle

Source: Internet
Author: User

1. Overview

Windows Azure is Microsoft's cloud computing platform. Used to build, publish, and manage applications in the Microsoft Data Center through a global network.

This chapter includes startup tasks and implementation of Start, Run, and Stop events.

2. Main content

2.1 Windows Azure

① offers two services for PaaS and IaaS.

PaaS provides an actual computing platform, including the operating system, the program execution environment, the database, and the Web server.

IaaS is the provision of virtual machines.

②windows Azure has three types of solutions: virtual machines, Web sites, and cloud services.

Virtual machines: They are used in a similar way to local machines and can be developed for testing and deployment.

Web site: A simple Web site homestay. You can easily deploy and run the ASP. NET MVC4 site.

Cloud services: The direct PAAs model is the initial release model for Windows Azure.

2.2 Startup Tasks

2.2.1 has three roles in Windows Azure: Web, Worker, and VM.

The web is typically used to perform IIS. A worker is typically used to perform intermediate-level programs. VM roles have full access to the virtual machine.

2.2.2 Through Startup tasks, you can register COM components, install components, or set up registry keys. Startup tasks is available only for web and worker roles.

startup tasks is defined in the task element, which is a node of the startup element in the Servicedefinition.csdef file.

A standard startup tasks is a command-line program or a batch file.

2.2.3 When a role is launched in Windows Azure, the following procedures are followed:

① instances are marked as starting and no longer receive notifications.

②startup tasks begin execution based on the TaskType property: (Simple tasks are synchronous, background, and foreground tasks are asynchronous.) )

The ③ role boarding process starts and the site is created in IIS.

④ calls the Microsoft.WindowsAzure.ServiceRuntime.RoleEntryPoint.OnStart method.

The ⑤ instance is marked as reader and starts receiving notifications.

⑥ calls the Microsoft.WindowsAzure.ServiceRuntime.RoleEntryPoint.Run method.

The 2.2.4 AppCmd.exe command-line tool is used in Windows Azure to manage IIS settings at startup.

2.2.5 Startup tasks can be executed multiple times. Forgetting to configure the AppCmd.exe tool can cause a run-time error.

2.2.6 can flag a task for execution in the background.

<Startup>     <task commandline="startup\execwithretries.exe                &quot;/c: startup\azureenablewarmup.cmd&quot;                 /d :/rd: &gt;&gt; C:\enablewarmup.cmd.log                2 &gt;&gt;&amp; 1 "           executioncontext="elevated " tasktype="background" /> </Startup>

2.2.7 Windows Azure virtual machine is stateless.

2.3 Implementing Start, Run, and Stop events

There are many conceptual similarities between the OnStart method and the Startup tasks:

The ① has the same timeout mechanism.

The ② role is re-executed when it is recycled.

③ can be configured prior to role processing.

The differences between the OnStart method and the Startup tasks include:

① to Be Continued ...

Chapter III Design of design program architecture implement Windows Azure role lifecycle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.