Monday, November 16, 2020

What is Infrastructure as code

Infrastructure as code (IaC) is the process of managing and provisioning computer data centers through files (ARM template, Terraform), rather than physical hardware configuration or interactive configuration tools. The IT infrastructure managed by this process comprises both physical equipment, such as bare-metal servers, as well as virtual machines, and associated configuration resources. The definitions can we be stored in version control system (Azure DevOps, GitHub) for Audit purpose.


Infrastructure as code is the approach to defining computing and network infrastructure through source code that can then be treated just like any software system.

-Martin Fowler


IaC is a key DevOps practice. Infrastructure as Code evolved to solve the problem of environment drift in the release pipeline. Modern cloud-native applications embrace the widely accepted practice of Infrastructure as Code. With IaC, you automate platform provisioning. You essentially apply software engineering practices such as testing and versioning to your DevOps practices. Your infrastructure and deployments are automated, consistent, and repeatable. Just as continuous delivery automated the traditional model of manual deployments, Infrastructure as Code (IaC) is evolving how application environments are managed.

Tools like Azure Resource Manager (ARM), Terraform, and the Azure Command Line Interface (CLI) enable you to declaratively script the cloud infrastructure you require.


Create App Service app using an ARM template

The template used in this quick start is from Azure QuickStart Templates. It deploys an App Service plan and an App Service app on Windows. It's compatible with .NET Core, .NET Framework, PHP, Node.js, and Static HTML apps. This is ARM template URL developed by Microsoft

ARM template: https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-app-service-docs-windows/azuredeploy.json



The above ARM templated created and maintained by Microsoft team. These templates stored-in GitHub.

We can use these templates and directly deploy these with help of Azure Portal or Power Shell command.

Need to follow below steps deploy ARM template created by Microsoft.

1.       Go to azure portal https://azure.microsoft.com/en-us/resources/templates/101-app-service-docs-windows

 

2.       Once you open above URL need to click on Deploy to Azure. It will ask you to enter you azure portal credentials.



3.       Form will be filled with all information which mentioned in ARM template like below.

 

4.       In above example I am using HTML hello world sample app (Created by Microsoft) which will be deployed automatically on newly created web app with help of ARM template.

GitHub URL: https://github.com/Azure-Samples/html-docs-hello-world

   

5.       Once all information filled need to click on Review + create. It will create web app with deployed code from GitHub repository as below



6.       Deployed app URL as below

URL: https://webapp-akfbpxosxv7rg.azurewebsites.net/

GitHub Source Code URL: https://github.com/Azure-Samples/html-docs-hello-world


Hope it will help you to understand Infrastructure as code (IaC) and how you can use them.

Keep sharing keep learning. Cheers 

No comments:

Post a Comment