Introduction to ARM Templates (AZURE IaC DevOps)
Azure ARM Template #JSON #IaC

Search for a command to run...
Azure ARM Template #JSON #IaC

No comments yet. Be the first to comment.
AWS Agent Plugins let AI coding agents deploy, architect, and operate on AWS. Here's what that means for the future of DevOps.

AWS Storage Gateway bridges your on-premises infrastructure with Amazon's cloud storage — letting you use familiar protocols like NFS, SMB, and iSCSI while your data lives safely in S3, EBS, or Glacie

This AZ-104 domain emphasizes secure identity management and efficient resource governance, which are essential for Azure administrators to ensure compliance and cost control. Overview of Azure Identi

Scaling your EC2 instances to match dynamic workloads can be challenging. Amazon EC2 Auto Scaling simplifies this with target tracking scaling policies, a powerful feature that automatically adjusts capacity to maintain optimal performance and cost e...

IntroductionAmazon Elastic Block Store (EBS) is a cornerstone of AWS storage solutions, offering persistent block-level storage for EC2 instances. While EBS volumes are typically attached to a single instance.# EBS Multi-Attach breaks this mold, allo...

CloudCubes by Jinesh
45 posts
Cloud Infrastructure Consultant
Find me here : jineshkumar.bio.link
https://jineshkumar.com
ARM (Azure Resource Manager)Templates are what really gives us the ability to roll out Azure “Infrastructure as code”.
They are project's infrastructure as Code in a declarative and reusable Template. A way to declare the objects/resources you want, the types, its names, and properties in a JSON ( JavaScript Object Notation ) file format which can be checked into source control and managed like any other code file. The templates can be versioned and saved in the same source control repository as your development project.
The advantages to Infrastructure as a Code are:
How ARM Templates configured ?
The template uses declarative syntax.
NOTE : Resource Manager orchestrates the deployment of the resources so they're created in the correct order. When possible, resources will also be created in parallel, so ARM template deployments finish faster than scripted deployments.

What is ARM Template JSON File Structure?
The template files are made up of the following elements:
apiProfile: An optional section that defines a collection of API versions for resource types. You can use this value to avoid having to specify API versions for each resource in the template.
parameters: An optional section where you define values that are provided during deployment. These values can be provided by a parameter file, by command-line parameters, or in the Azure portal.
variables: An optional section where you define values that are used to simplify template language expressions.
functions: An optional section where you can define user-defined functions that are available within the template. User-defined functions can simplify your template when complicated expressions are used repeatedly in your template.
File structure of a ARM Template .JSON file
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.1",
"apiProfile": "",
"parameters": { },
"variables": { },
"functions": [ ],
"resources": [ ],
"outputs": { }
}
To be honest, It is very tedious and error pron way to create an ARM template from scratch. But Don't worry, Azure has us covered.
Visual Studio Extension to the rescue.

The Azure Resource Manager (ARM) Tools for Visual Studio Code provides language support, resource snippets, and resource auto-completion to help you create and validate Azure Resource Manager templates.
Also, Azure Portal has a quick and easy way to generate ARM Templates from basic configuration created using Portal. You do not need to deploy the resources using azure portal. Just Download the Template as it has created while configuring the basic resource creation process on the azure portal. And then we can edit, add, remove, customize, and Improve the template to make it Deployment ready for us as we desire.
I feel that is the quick and easy way to create new ARM Templates.
For Example,

In above Screenshot, Shows a "Storage Account" Resouce creation (It can be any azure resource) using Azure Portal.
Select Review + create on the bottom of the screen. DO NOT CLICK Create in the next step.
Select Download a template for automation on the bottom of the screen. The portal shows the generated template:
Select Download Template as per,

The downloaded JSON file can be open in VS Code or a normal Notepad Application.
If you notice there are parameters defined like "location" , "StorageAccounrName" , "AccountType", "Kind", "accessTier", "minimumTLSVersion" "AllowBlob/SharedKeyAccess" and its Values as per,

You can edit and Customize the "Value" of each parameter as per your desired configuration to make it a Custom ARM Template.
Once Desired Configuration on Custom ARM Template is set by the Edit of the JSON file. You can Deploy the Custom Template directly back to Azure Portal. Check below,
Or
How Cool !! Right?
And this is just a basic example I give here to understand the concept of ARM Template.
You can make a custom ARM Template with much more using almost all Azure Resources and make it deploy ready and add it to your code repository for version control and CI/CD deployments.
Or use Azure CLI Create Resource group
az deployment group create \ --name blanktemplate \ --resource-group myResourceGroup \ --template-file $templateFile
Deploy your created Template.json file
$templateFile="{provide-the-path-to-the-template-file}" az deployment group create \ --name blanktemplate \ --resource-group myResourceGroup \ --template-file $templateFile
And verify from Portal of our successful ARM teplate deployment
Resource to Learn more :
Microsoft Azure Github Repo for multiple examples of ARM Templates
AzureStack-QuickStart-Templates
Feel free to try and Let me know if you have any questions or improvements I can provide.
I hope you like the Blog: Introduction to ARM Templates.
Thanks for the read.
Follow for more Awesome Azure and AWS Content.
Regards,
Jineshkumar Patel