Tutorial: Building and Deploying a Microservices Application with Azure Container Instances
In this tutorial, I will walk you through the steps involved in deploying an end-to-end application in Azure Container Services that utilize Azure Container Instances, Azure Container Registry, and Azure Cosmos DB.
Azure Container Instances (ACI) are serverless containers that can be provisioned directly without host VMs. They are lightweight, ultra-fast instances that are priced on a per-second execution model. ACIs are designed for executing code that’s typically invoked in response to an external event. These instances are short-lived which exit after their job is done.
Though this tutorial doesn’t highlight the typical use case of ACIs, it demonstrates the lifecycle of such as an application. As we deploy the application, we will explore how to use Azure Container Registry to store images, and move the state to Azure Cosmos DB.
The application that we deploy is a simple stack app that needs a MongoDB backend. Since Cosmos DB is compatible with MongoDB, we will simply point the application to an instance of Azure Cosmos DB with no changes to the original code.
By the end of this deployment, we will have an Azure Resource Group that will have the resources shown below:
Preparing the Environment
Let’s start by pulling the right images from Docker Hub and testing the application on our development machine. You need Docker for Mac or Docker for Windows to test the application.
Run the following commands to check out the application.
$ docker run -d --name db mongo$ docker run -d -p 80:3000 --link db:db --name todo janakiramm/todo
Accessing the application shows a simple user interface in the browser:Read the entire article at The New StackJanakiram MSV is an analyst, advisor, and architect. Follow him on Twitter, Facebook and LinkedIn.
