Using Nodejs as a Microsoft experienced developer
nodejs.org

Using Nodejs as a Microsoft experienced developer

Here is small update on Nodejs for those interested and not too familiar with it. Nodejs has become an important application server technology. It is used for many web sites and other backends. It is able to run on both Windows, Linux and in containers (eg. dockers) as a javascript runtime running on the Chrome V8 javascript engine. It is not available on mobile or IoT devices, but can be expected to be increasingly availably on the latter.

Microsoft has embraced the technology. Key offerings such as Office 365, Azure functions and Azure based mobile backends depend on Node.js.

If you are a Microsoft experienced developer, you might wonder: can I have the usual full experience and build a nodejs application in Visual Studio and set up automated build and deployment to Windows Azure. The answer is as expected: yes.

Begin by adding the Nodejs tools for Visual Studio and use one of the nodejs project templates. This enables debugging, unit testing, etc. At this point you are actually also able to deploy it directly to an Azure app service (web application) from VS. (The template has made the necessary changes to the web.config, so it will run a special module on the Azure web site enabling nodejs).

But we want this to be done through the VS Team Services system in a continuous delivery scenario. To achieve this the only thing we need to change in the project is to add a Gulp.js file, that will package the nodejs application in a zip file. Having that in place, we can add a gulp task to the build definition, that will run the gulp script and package the app before it is deployed to Azure in the subsequent build step (we could also make it a release step). By the way, continuous delivery is in preview in Azure Portal, so very nice, but it only so far handles asp.net and asp.net core, so we created the build definition ourselves.

Below an example of a completed build, including the gulp task.

Below the Gulp script.

For more details on the invididual steps, the web has some pretty good guides, and I can supply more details.

Happy coding!

Laurits West ??

Senior Software Developer at Jabra, GN Audio

8 年

Der er nemlig mange muligheder i det

要查看或添加评论,请登录

William Jansen的更多文章

社区洞察

其他会员也浏览了