This is an approach of managing infrastructure where infrastructure is described in configuration files and then used to create the infra automatically.
Tools:
Azure:
ARM Templates
Bicep
AWS:
Cloud formation
Generic:
Terraform
Advantages:
Reusability
managing multiple environments
Every change in infra is version controlled
Azure Resource Manager (ARM)
This is the basis for Azure IaC Capabilities via ARM templates.
Azure provides capabilities by Resource Providers which are registered to subscription.
Resource Providers provide services and operations
refer the below image
When we are using Azure either from portal/CLI/Powershell/SDK we interact with Resource providers
Experiment: Create a vm in Azure Portal.
After succesful creation, Navigate to Resource Group and then deployments, select deployment and view template
So when we create something from azure portal it is creating template.
Azure CLI/Powershell and SDK directly interact with Management API of Azure to create resources where as portal tries to create a template.
To create custom templates for our infrastructure we need to express infrastructure as a code using ARM/Bicep.