The Azure Cloud Platform Learning Path (iii)--cloud Services

Source: Internet
Author: User

1. What is a cloud service?

The ability to deploy highly available and infinitely scalable applications and APIs. In short, the CMD program you write can be run on the Azure cloud platform with a small amount of modification in a certain framework.


2. What are the characteristics of azure cloud services?

(1) Focus on applications rather than hardware, a PAAs.

(2) Support multiple frameworks and languages.

(3) Integrated health monitoring and load balancing.

(4) Automatic scaling optimizes cost and performance



3. Before setting up a cloud service, we need to build a cloud storage to record the log information of our program (of course, this is not necessary)

(1) Select "Save" in the left navigation bar. A list of all existing stores is displayed on the main panel. Click the New button below.

(2) Select data Service-"storage-" quickly create, and enter the URL, location, select the redundancy policy, click the Create Storage button.

(3) Set the log storage time. Select the storage service you have created and click Configure. Turn on monitoring and logging, and set the retention period. If you do not open it, you cannot keep the log information.


4. Create a cloud service

(1) Click on the "Cloud services" navigation button on the left, the main panel displays the list of existing cloud services, click the "New" button below

(2) Select Compute-"cloud service-" quickly create, enter the URL and location, click Create Cloud Service.

5. Change the local app to cloud service

(1) on the vs2013, document-"New-" project

(2) Select Windows Azure Cloud Service under Visual C # and click OK.

(3) In the New popup box, select Worker role to join to the right, this is the background processing service. and modify the name. Click OK

(4) in the WorkerRole.cs file, there is a number of lines:

public override void Run () {    //This is a sample worker implementation. Replace with your logic.    Trace.traceinformation ("Groupmeetingworkerrole entry point called");     while (true)    {        thread.sleep (10000);        Trace.traceinformation ("Working");}    }

This is the program entry, which is equivalent to the main function.

(5) If the code of the original offline program is copied all over, there are two parts of the code, which increases the cost of our maintenance. There is a lazy way to add the original project to the Workerrole project. This only requires maintaining a program code.

A. Right-"add-" reference to Workerrole Project

B. Select the solution, project in the Pop-up dialog box, choose the local program you want to convert, and click OK.

C. Change the code inside the WorkerRole.cs run method to the code within the main function in your groupmeeting. At this point the code for the Run method is as follows:

public override void Run () {    groupmeeting groupmeeting = new groupmeeting ();    while (true)    {        groupmeeting.introduce ();        System.Threading.Thread.Sleep (30000);    }    Console.readkey ();}

6. Publish Cloud services to Azure

(1) Configure Workerrole information. As shown, click on the 1 Roles configuration, select Configuration, choose 3 in the Enable diagnostics, here I choose to save all the messages (the program has trace/verbose/error, etc.), you can choose to keep only the error message, You can also customize some information. Select the button in the 4 after selection. Select your subscription in the Pop-up dialog box, select Account and cloud storage service in the dropdown box below, click OK, save.

(2) Release configuration. Right-click on the Cloudservice project and select Publish

Select an account.

Select the cloud service in the common settings and run the environment.

Select the storage account in the advanced settings.

Click the Next,pushlish button.


7. View the log information.

(1) Click on VS2013 to the left of the server Explorer, select Windows azure-"storage-" Your cloud storage-"tables-" double click wadlogstable

(2) The log information in the program is displayed.

(3) Microsoft Azure Resource Explorer can also be used to view log information for internal users. Http://codebox/azexplorer, this link can only be accessed within Microsoft.


Resources:

[1] http://azure.microsoft.com/zh-cn/services/cloud-services/

[2] https://manage.windowsazure.com/


Reprint Please specify: Kangrui tribe? The Azure Cloud Platform Learning Path (iii)--cloud Services

The Azure Cloud Platform Learning Path (iii)--cloud Services

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.