Deploying a Node.js app in Microsoft Azure using Git

Index:

Step 1: Analyze your app
Step 2: Choose a Microsoft Azure environment
Step 3: Initialize git repository
Step 4: Push the app to the cloud


Step 1: Analyze your app


Hi :)

First of all, you need to analyze your Node.js application goals in order to decide, what kind of solution you are going to choose in Microsoft Azure. 
Microsoft Azure offers several ways to host web sites: Azure WebsitesCloud Services, and Virtual Machines.

Let's make easy to know how to do this.

Source: http://azure.microsoft.com/enus/documentation/articles/choose-web-site-cloud-service-vm/


Step 2: Choose a Microsoft Azure environment



So, basically Microsoft Azure offers three cloud deployment models for applications to be deployed in any of the eight Microsoft global datacenters: Virtual Machines (VMs), Cloud Services and Web Sites. The most appropriate deployment model depends on the level of scale, control and flexibility you require. 

To choose the most appropriate solution for your app, here we have a decision tree for determining where to deploy your Node.js solution, based on infrastructure and software components required by the application. 


Decision tree :)
Source: http://msdn.microsoft.com/en-us/magazine/jj991974.aspx



Step 3: Initialize git repository


Ok, let's do this fast.

1. Get Git (Get it here if you don't have it yet)

2. Download the next working example of a Node.js app from Github here

     Or clone it :)
git clone https://github.com/Kodran/nodejs-with-microsoft-azure.git
    
3. Init Git repository (if you did not clone it)

Go to your Node.js application path then type this:
git init
git add .
git commit -m "initial commit"


Step 4: Push the app to the cloud

Before pushing the app to the cloud, we need to create one of the three cloud deployment models in Microsoft Azure with Git repository.

Here I share you some articles for each cloud solution:


For Virtual Machines is a little bit more complicated, but Michael Dukehall explain us how to setup a VM with Ubuntu, Node.js and express.


Virtual Machines 

Then by SSH install Git with the following command:


sudo apt-get install git

Alright, we have now a git repository in our cloud solution, now is time to push our application to the cloud
git remote add azure {remote azure git repository}
git push azure master

Comments

Post a Comment

Popular posts from this blog

Configurar y desplegar una Web API en Azure App Service Environment

Despliegue de contenedores Docker a Azure Web Apps

Patrones de diseño para aplicaciones de alta disponibilidad en Azure - Resilient Applications (Parte I: Retry Policy)

Conectar .NET Web API con Azure API Management

Configurar trigger de Integración Continua en VSTS para ejecutar una tarea de compilación al subir cambios en Source Control