Module 3 - Configure Resources with ARM templates Flashcards
ARM templates
it is based on the JSON format. Key and value pairs
Infrastructure as a code
JSON files that define the resources you want to deploy.
If the resource already exists and no change is detected in the properties, no action is taken. If the resource already exists and a property has changed, the resource is updated. If the resource doesn’t exist, it’s created.
ARM templates advantages
- Improves consistency and promotes reuse
- Reduce manual , error prne , and rep
3.
4.
5.
6.
ARM templates Schema
Defines all the resources in a deployment
- Written in JSON
- A collection of key - value pairs
- Each key is a string
- the string value can be a , a string , a number , Boolean expression , list of values , an object( Which is a collection of other key-value pairs)
JSON template parameters
In the parameter section is where you specify which values you can input when deploying the resources.
Azure Bicept files
Is a domain specific language that use declarative syntax to deploy azure resources.
Simpler syntax for writing templates. You can reference parameters and variables without using complicated functions.
Modules - you can break down complex deployments into smaller files and refence them in a main template.
Automatically detects dependencies between resources.
Azure Bicep comparison to Azure arm template.
Example of deploying an azure storage account:
ARM template: JSON
{
“$schema”: “https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#”,
“contentVersion”: “1.0.0.0”,
“resources”: [
{
“type”: “Microsoft.Storage/storageAccounts”,
“apiVersion”: “2019-06-01”,
“name”: “mystorageaccount”,
“location”: “East US”,
“sku”: {
“name”: “Standard_LRS”
},
“kind”: “StorageV2”
}
]
}
Bicep: Yaml
param storageAccountName string = ‘mystorageaccount’
resource storageAccount ‘Microsoft.Storage/storageAccounts@2019-06-01’ = {
name: storageAccountName
location: ‘East US’
sku: {
name: ‘Standard_LRS’
}
kind: ‘StorageV2’
}