Deploy Containerized Ruby app to Azure in 5 minutes

Sometimes its difficult to understand where to start, how to plan, what to use while designing your pipeline. Azure DevOps Starter makes it easy by providing sample pipeline for verities of languages and frameworks. With Azure DevOps Starter you will be able to create your CI/CD pipeline in few minutes. Azure DevOps Starter provides pipelines for Node.js, Java, .Net, Python, Ruby, Go, Static Website, PHP and C.

In this exercise we will be:

  • Uploading sample Ruby web app code to Azure DevOps Git
  • Building Continuous Integration Build pipeline
  • Building Continuous Delivery release pipeline
  • Creating Platform as a Service (PaaS) Web App in Azure to deploy our sample Ruby app
  • Enabling application monitoring with App Insights

Pre-requisites

Azure account – https://portal.azure.com Create an Azure account if you don’t have one

Azure DevOps account – https://dev.azure.com/ Create an Azure DevOps organization if you don’t have one, this organization will be used to create CI/CD pipeline

Steps to build CI/CD for sample app as follows:

  1. Login to https://portal.azure.com
  2. Search for DevOps Starter and select DevOps Starter resource. Click on Create
DevOps Starter

3. Select Ruby app and click on Next

4. Select Ruby on Rails framework and click on Next

Ruby on Rails

5. Since we are deploying Docker containerized application, select Web App for Containers block and click Next

Web App for Containers – Ruby

6. Enter below details:

  • Project name: RubySampleWebApp (Give a unique name)
  • Azure DevOps Organization: Select your Azure DevOps organization which you created earlier or your existing organization
  • Subscription: Select your Subscription
  • Location: Select your preferred location to host

Click on Done. This step will few minutes to provision resources and build CI/CD pipeline.

7. Once the deployment is done, click on Go to Resource button. Here we can see DevOps Starter has created below items for us:

  • Created CI/CD pipeline for Ruby Web App
  • Git Code repository and uploaded our sample Ruby web app
  • Created Web App resource in Azure
  • Deployed our Sample application to Azure web app

Click on Browse button to Navigate to web app. We can see Sample application is deployed successfully.

Lets dig into Build pipeline, click on the Repository Code button from DevOps project resource we have created. This will take you to Azure DevOps. Azure DevOps is an Microsoft platform to manage work, build and manage CI/CD pipeline. In this below slide we can see the sample Ruby App code is being uploaded to Git in Azure DevOps

Select Pipelines Under Pipelines tab to look into Build Pipeline. Here you can see out last build was success, which was initiated by Azure DevOps Starter resource. Now click on Build Definition i.e RubySampleWebApp – CI.

Select Edit to see the Build definition steps.

Below we can see CI Steps to Build Ruby application

Lets look into our Release Pipeline, we can see that CD has run successfully and our app has been deployed to Azure.

Here we can that CD pipeline deploying to one Azure environment, In this view we can configure Deployment to Cloud/On-prem Servers. You can click on Add to configure QA, Stg, Prd environments through which you can deploy to Azure, AWS or even other cloud providers. Select 1 job, 2 tasks to see the Deployment tasks.

Release has just two tasks to deploy to Azure. This task picks App image from Azure registry and deploys to Azure Web App

To see application performance, click on Application Insights resource from Azure Portal:

We can see metrics like Failed Response, Response Time and more. Application Insights is a powerful resource for all monitoring aspects.

We have successfully create CI/CD pipeline and Deployed sample Ruby app to Azure.

You can modify any content and commit the code, CI/CD will be triggered automatically and you will be able to see your changes in few minutes.

Reference/Further studies:

Learn end to end DevOps implementation and get certified as Microsoft Azure DevOps Solutions:

https://docs.microsoft.com/en-us/users/drfrank/collections/584uq7y8ggnrr

Azure DevOps gives lot of flexibility and extend-ability. please check out Azure DevOps Documentation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s