Making sense of Microsoft’s cloud developer platform

Автор: | 18.06.2018


In early 2016, Microsoft stated in a “Microsoft by the numbers” announcement that more than 25% of Azure virtual machines (VMs) were Linux. By the end of 2016, it was saying “nearly one in three”. In October 2017, it announced 40% of VMs in Azure were running Linux.

«;
}
});

/**
* remove unnecessary class from ul
*/
$(«#inlineregform»).find( «ul» ).removeClass(«default-list»);

/**
* Replace «errorMessageInput» class with «sign-up-error-msg» class
*/
function renameErrorMsgClass() {
$(«.errorMessageInput»).each(function() {
if ($(this).hasClass(«hidden»)) {
$(this).removeClass(«errorMessageInput hidden»).addClass(«sign-up-error-msg hidden»);
} else {
$(this).removeClass(«errorMessageInput»).addClass(«sign-up-error-msg»);
}
});
}

/**
* when validation function is called, replace «errorMessageInput» with «sign-up-error-msg»
* before return
*/
function validateThis(v, form) {
var validateReturn = urValidation.validate(v, form);
renameErrorMsgClass();
return validateReturn;
}

/**
* DoC pop-up window js — included in moScripts.js which is not included in responsive page
*/
$(«#inlineRegistration»).on(«click»,»a.consentWindow», function(e) {
window.open(this.href, «Consent», «width=500,height=600,scrollbars=1»);
e.preventDefault();
});

At last month’s Build developer conference, Corey Sanders, Microsoft corporate vice-president for Azure Compute, said it had risen to “more than 40% Linux”. He also said he’d be troubled if the share of Windows VMs on Azure were to shrink further.

The discussion goes to the heart of the wider question: what is happening to Microsoft’s platform? The slogan “Microsoft loves Linux” is not just empty words, as the Azure data confirms.

On the client side, Microsoft has abandoned Windows Phone in favour of developing its own applications for Apple iOS and Google Android. Microsoft Word for Android has been downloaded over 500 million times.

Windows Subsystem for Linux

Another notable development is the Windows 10 feature called Windows Subsystem for Linux (WSL). This is a remarkable piece of engineering that enables Linux binary code (native ELF64) to execute on Windows. Linux system calls are translated into Windows application programming interface (API) calls.

This enables Linux distributions – now including Ubuntu, openSuse, Suse Linux Enterprise, Debian and Kali – to be installed from the Windows Store. This feature is not aimed at general users, but rather at developers who now have access to a Linux toolchain in Windows – as well as the use of countless command-line utilities. There is no officially supported Linux graphical user interface (GUI), though it can be hacked.

Using WSL rather than a VM running Linux means deep integration, including access to the same file system, and the ability to launch Linux executables from Windows and Windows executables from WSL.

The reason is for WSL to remove friction for developers targeting Unix-like platforms. They can configure Windows 10 to run code editors on the Windows side (including Microsoft’s open source offering Visual Studio code), while compiling and running in WSL.

Microsoft has gradually improved WSL, and the latest version (in the April 2018 update to Windows 10, build 1803) has a number of enhancements. These include per-directory case-sensitive file names supported on the Windows side, as well as from Linux; Unix Sockets; background tasks; and a utility to convert path names between Windows and WSL.

Developers using Visual Studio code, with Node.js, can target WSL simply by setting the attribute “useWSL”: true in the launch configuration file.

Cross-platform .Net and developing for Linux with Visual Studio

Microsoft has undertaken several initiatives to make targeting Linux or cross-platform projects possible with Visual Studio. Enabling WSL is not essential. At the end of 2014, the company announced .Net Core, a fork of the .Net Framework which is open source and runs on Windows, Linux and Mac. Now at version 2.1, the supported platforms include the ARM-based Raspberry Pi. Indeed, .Net Core is supported by frameworks including ASP.Net Core and Entity Framework Core, both also at version 2.1.

New investment

Microsoft still supports the Windows-only .Net Framework, though the company has stated that new investment will be on .Net Core and not .Net Framework.

At Build, Microsoft announced the forthcoming .Net Core 3.0 will support Windows desktop applications, a key step in shunting .Net Framework towards a legacy support role.

The snag here is that .Net Core only supports a subset of .Net Framework features. Notable omissions are support for ASP.Net Web Forms, Windows Communication Foundation (WCF) services and Windows Workflow Foundation.

There is also a bias towards C# in .Net Core, meaning that while Visual Basic and F# are also supported, they do not support all project types.

On the other hand, there are also strong reasons to use .Net Core. Raw performance is generally better – sometimes dramatically so. It has also been designed with microservices in mind and runs nicely in both Linux and Windows containers.

In Visual Studio, targeting Linux containers with ASP.Net Core is a matter of installing Docker for Windows, which uses Hyper-V virtualisation, and adding Docker Linux support to the application via a right-click menu. Note that Microsoft now also offers SQL Server for Linux.

Cross-platform mobile

At the client end of a modern application, developers often have to write code for a smartphone, an iPad or a Chromebook rather than a PC.

To target the end-to-end stack, Microsoft required cross-platform mobile development tools, and in early 2016, it acquired Xamarin to obtain C# compilers for iOS and Android.

The Xamarin compilers are based on Mono, an earlier open source implementation of the .Net Framework, but Microsoft is now working to share as much code as possible between Xamarin and .Net Core.

Using Xamarin, developers can either write shared non-visual code and combine it with a native GUI for each platform or use an abstraction called Xamarin Forms to share GUI code as well. Both approaches use native platform GUI controls rather than emulating them with custom drawing.

At the Build conference, the Xamarin team announced a preview of support for Google’s Android Emulator on Hyper-V. This will resolve a pain point for developers, whereas the Android emulator requires Intel’s HAXM to be enabled, which disables Hyper-V.

Xamarin can also target the Mac desktop, though not from Visual Studio. Targeting MacOS must be done on a Mac, for example, using Visual Studio for the Mac.

Other options for mobile development

There are other options for mobile development with Visual Studio. Microsoft provides tools for Apache Cordova, for apps built with JavaScript (or TypeScript, a superset of JavaScript) and HTML.

Developers can also write C++ code and compile for iOS and Android.

Microsoft’s Linux strategy

Might Windows development become a niche activity and Linux the mainstream – even on Microsoft’s platform?

The answer is that the company still has a strong incentive to promote Windows Server with its deep integration into Active Directory and other server products, including Exchange, Dynamics, SQL Server and so on.

This is more about Microsoft recognising that public web applications are already dominated by Linux, and that if customers are running on Azure it can prosper regardless of the preferred operating system.

The upside for Microsoft is that it can offer cloud services to developers working with Java, Node.js, PHP or other technologies without the friction of running on Windows.

Microsoft’s Linux support is also a key part of its microservices and DevOps story.

When the company talks about cloud-native applications, it means applications broken down into microservices and easily scaled.

Microservices generally also implies containers, though there is also a serverless platform called Azure Functions. Taking advantage of managed services such as Azure SQL or CosmosDB (Microsoft’s no-SQL database manager), rather than hosting a database server, reduces the maintenance burden and lets developers take advantage of the built-in scalability of these Azure services.

Source

Добавить комментарий