📜 ⬆️ ⬇️

Updated Azure Web Sites cloud service for hosting PHP, Java, .NET, Node.js and Python sites

This article is the addition and continuation of the article Single Cloud PaaS Platform for ASP.NET, PHP, Node.js, and Python . Since writing the previous material, the Azure Web Sites service has been significantly updated and its capabilities have expanded in many directions at once. These changes will be discussed in this article.



The following features are discussed:
')

Consider each of the new features in more detail.

What is Azure Web Sites?


For those who have not read the previous article describing the capabilities of Azure Web Sites, we briefly list these features:

Azure Web Sites is a ready-made platform for hosting your applications (PaaS). Projects based on .NET, PHP, Node.js, Python, Java are supported with the provision of the opensource SDK for each platform.

The platform integrates with version control systems: Git, TFS, Visual Studio Online, BitBucket, GitHub, Codeplex, Dropbox, offering developers continuous integration and code distribution features.

The platform offers a set of CMS and frameworks from WordPres and Drupal to Django and DotNetNuke ready for deployment from the gallery of templates.

Being a PaaS platform, Azure Web Sites assumes all the tasks of managing and updating the OS, database, runtime environments, including the task of load balancing between multiple instances of your code.

Developers are offered the functions of manual and automatic scaling of sites. Scaling up and down occurs in seconds. Developers can scale the number of CPU and memory size, as well as the size of the relational storage.

The platform has access to all other Microsoft Azure services. which allows you to expand the capabilities of your sites through a large number of cloud tools: identification, blobs, tables, big data, analytics, messaging services and others.

The Azure Web Sites portal and platform offer rich administration, site diagnostics and monitoring tools.

All these features are available to users on the first request within a few seconds. At the same time, the Azure Web Sites base rate is free, which allows you to start developing or prototyping sites for free, scaling them as required without making any changes to the code.

Next comes a description of the new features that have appeared on the platform over the past six months.

Java project support


In addition to supporting PHP hosting, Node.js, .NET, and Python, Java code support has become available .



Developers can place both 32-bit and 64-bit Java 7 code (configurable via the configuration file) and choose between the default Tomcat or Jetty servers. At the same time, the developer can download his own version of Java (including 6 or 8) or his own application server to choose from.

Currently, there are the following limitations of Java support on Azure Web Sites: applications can only listen for HTTP (S) traffic, no support for JMX or JMS messaging, no support for JDWP or JDI remote debugging,

Several introductory articles on the topic of hosting Java projects in Azure Web Sites can be found on the official portal .

Integration with Visual Studio Online “Monaco”


With the release of testing new visual online editor Visual Studio Online “Monaco”, you can now edit the hosted Azure Web Sites web sites directly in your browser.

To access the site code through a web editor, you must enable the appropriate setting in your Azure Web Sites settings.

image

After that, through a link in the administration panel you can directly access editing the site content:



When you go to the Monaco editor page, you can manage the Git repository of the code, if you have one, or create it if it does not already exist.



For managing Git and other functions, developers can use the built-in administration console:



Finally, the code editor allows you to conveniently edit various types of files, including code, web pages, styles, scripts, and so on, with support for hot keys, intelliSense, syntax highlighting and code completion:





One of the features of the code editor is to instantly apply changes without having to save changes explicitly. Another possibility is to work with the git-repository (git push):



Using Monaco can be a very convenient way to access the site code and the ability to quickly make changes from any browser on any OS or platform.

Site backup feature


The task of creating backup copies of Azure Web Sites web sites is now fully accomplished with built-in backup support. With the built-in management functionality in the portal, you can configure the automatic creation of a backup copy of the entire website, including databases.

image

Developers are offered the opportunity to choose a location (storage account) to save backups, the frequency of backup creation on the day, the date from which to start creating backups and the database to be included in the backup.

Staging and other advanced deployments


One of the most popular site hosting features recently introduced was the function of additional deployments of code deployment, for example, to create next to the production environment, additional test, staging, or any other environment on demand.

image

Additional code deployments are designed for testing and running code in a real cloud environment with the ability to quickly change production-deployment to any of the additional and back.

image

Switching can be especially useful when an error was detected in the output of one of the staging code in the production and you want to quickly return the state back. Switching environments is done with a single click and within a few seconds.

You can add a new slot of a deployed application from the administration panel of the original site, just enter the name of the new environment:

image image

Some details on the use of styling environments, including control via command line commands and PowerShell, can be found in this article .

Perform background tasks (Web Jobs)


In addition to running the main code of a hosted web application, Azure Web Sites can perform background tasks ( Web Jobs ) on demand, on schedule, or continuously. You can execute command line scripts or Python, PHP or Node.js code, as well as any .NET or Win32 application code that can be run on Windows Server (files with * .exe extensions * .cmd * .bat * .sh * .php * .py * .js).

Web tasks can be especially useful for performing background tasks for sites that are not 100% loaded and have the ability to allocate some resources for additional tasks. For example, a site may have a web task for handling user-uploaded posts. By this, the developer not only utilizes the unused capacity of his site, but also saves money on cloud capacity, since he does not have to create a separate working role for the image processing task.

It’s very easy to add a new web task to Azure Web Sites through the management portal:

image Particular Weekly Schedule

Tasks can be performed on demand, on schedule, or continuously, depending on their purpose. Placing a web job can be conveniently integrated into the process of publishing a website from Visual Studio. For this purpose the WebJobsVS extension is intended:

image

After installing it, the developer can use the new configuration feature of the web project in Solution Explorer:

image

This feature allows you to map one of the internal projects of the solution in Visual Studio with a web task, for example, a console application that will be automatically compiled and published along with the publication of the web application itself.

image

Of particular benefit for developers who want to use web tasks can be the Azure WebJobs SDK toolkit, you can install it using the Nuget command:

Install-Package Microsoft.WindowsAzure.Jobs.Host –pre

The installed library will allow you to use additional features for integrating the web task code with the cloud environment, for example, with queues or blobs of Azure Storage.

image

For example, the code above uses special attributes that allow you to match the input parameters of the background task with specific queues and blobs containers in Azure storage. These features of the WebJobs SDK allow a developer to very quickly build a console application that will process data based on a message queue and store the results into a specific storage container. In this case, all actions on data transfer, sampling from the queue and saving the results will be taken over by the SDK tools.

Additional Information:


Details on using the Azure WebJobs SDK can be found in the article Getting Started with the Azure WebJobs SDK .

Remote debugging


The rich capabilities of working with Azure Web Sites from Visual Studio are replenished with the function of remote debugging of cloud-hosted code, both in the production environment and in any of the additional staging environments.

For security reasons, remote debugging should be explicitly enabled in the site administration panel, for the same reason, after switching on, the function remains working only for 48 hours:

image

After enabling remote debugging for a website, you can connect the debugger to a site in the cloud directly from Visual Studio:

image

The ability to debug code in a working cloud environment is a very powerful tool. It is further strengthened by the Web Sites staging environment feature, which allows debugging the staging code in a real cloud environment without affecting the operation of the site in production.

Wildcard domain support and free SSL certificates


Now users of the standard Web Sites edition get a free opportunity to enable SSL mode support for their web applications. Users can count on one free IP address and 5 SNI.

In addition, support for wildcard domains was introduced in Azure Web Sites, which allows you to link a domain to a site and access it through higher level domains.



Details on supporting and configuring the use of wildcard domains can be found in this article .

AlwaysOn function


The new Web Sites feature called Always On allows you to keep the hosted web application in an active running state.

image

After enabling this feature, Azure will periodically ping your site so that it does not turn off or fall asleep and is always “warmed up”.

Web Socket Support


Web socket technology allows web applications in a browser to exchange real-time data with the server backend. Web socket support was added in Windows Server 2012, a bit earlier it was available to Azure cloud services. Now, web applications hosted in Azure Web Sites also have the ability to use web sockets.

image

To enable web socket support, go to the admin panel and enable the appropriate setting. Please note that projects that previously had to use other real-time data exchange technologies, for example, based on SignalR , will immediately receive all the benefits of the new function without any changes in the code.

Administration


Several new administrative features of Azure Web Sites include setting up access to sites by IP addresses and advanced control panel sites - Kudu.
Restricting access by IP The ability to use the IIS server’s IP and Domain Restrictions features has been enabled for Azure Web Sites websites. These additional settings can be used in conjunction with the previously introduced Dynamic IP address restriction (DIPR) function .

Now developers can restrict or grant access to sites by specifying a set or range of specific IP addresses. A detailed description of this IIS server function can be found here .

Kudu integrated administration panel

For each website launched in Azure Web Sites there is a Kudu control panel that allows you to easily manage a number of website parameters, get diagnostic information and logs. You can access the Kudu panel at https: // YOUR WEBSITE.scm.azurewebsites.net/ .

image

In a recent update, Kudu introduced a new ability to view and manage the list of processes, load memory dumps of processes, and stop processes. And through https: // YOURSITE.scm.azurewebsites.net/azurejobs/ it became possible to manage and diagnose the work of Web Jobs web tasks.

Manage with Azure Management Libraries

With the release of the Azure Management Libraries, a large part of the Microsoft Azure cloud infrastructure can be accessed and automated from .NET applications. These libraries run on top of the open REST API functions of the platform and their release is designed to facilitate the work of the developer with the cloud infrastructure.

Azure Management Libraries libraries offer the ability to manage the following cloud capacities:


If you want to manage only one aspect of Azure, then instead of adding all the libraries, you can install only one specific package, such as Microsoft.WindowsAzure.Management.WebSites , which offers the functionality to manage only the Azure Web Sites infrastructure.

Library source code is available on GitHub .

Azure Management Libraries libraries offer an excellent automation layer between your code and Microsoft Azure. You can use these libraries to automate the entire spectrum of Azure component creation and deletion processes. In the current version, we offer libraries for managing computing capacity and cloud storage, as well as components of Azure Web Sites. Over time, we will add more functions to the libraries. Our goal is to provide you with the ability to automate the execution of any task in Microsoft Azure.

A detailed description of the use of libraries Azure Management Libraries can be found in this article . A good example of managing Web Sites from your own websites can be found in this article .

New pricing


Web Sites pricing has been slightly modified , a new level of Basic service has been added, which offers dedicated computing power, but costs up to 50% cheaper than the standard level due to the unavailability of a number of functionalities, such as automatic scaling.

image

Learn more about the new pricing of Azure Web Sites on the official page . You can read more about hosting plans in this announcement .

image image

The standard website hosting plan received an update: in addition to the free SSL offer, the amount of storage space allocated for the website was increased from 10 GB to 50 GB.

image

In addition to new hosting plans, a new approach to combining several websites with different pricing - Resource Groups was introduced. This feature will help manage resources and allocate them in different ways for different tasks. More information about the new features can be found in this article .

useful links


Below you will find links to resources that will help you in using the Microsoft cloud platform:


And if you are already developing on Microsoft Azure or want to find the developers of your service, visit appprofessionals.ru .

We will be happy to answer your questions at azurerus@microsoft.com . And we are waiting for you in the Microsoft Azure Community on Facebook . Here you will find experts (don't forget to ask them questions), photos, and lots and lots of news.

Source: https://habr.com/ru/post/221045/


All Articles