Skip to content

markkerry/arm-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arm-templates

Bicep - ARM DSL

Create a .bicep file

New-Item -Path . -Name storageAccount.bicep -ItemType "File"

To compile it, modify it and to save changes

bicep build storageAccount.bicep

Deploy it

Connect-AzAccount
New-AzResourceGroup -Name MyRG -Location westeurope
New-AzResourceGroupDeployment -TemplateFile ./storageAccount.json -ResourceGroupName MyRG

Or Azure CLI

az login
az group create -n MyRG -l westeurope
az deployment group create -f ./storageAccount.json -g MyRG

How a template is converted to Rest API operation

When you create an arm json file such as the following:

"resources": [
  {
    "type": "Microsoft.Storage/storageAccounts",
    "apiVersion": "2019-04-01",
    "name": "mystorageaccount",
    "location": "westus",
    "sku": {
      "name": "Standard_LRS"
    },
    "kind": "StorageV2",
    "properties": {}
  }
]

When you deploy it, it converts the definition to the following REST API operation, which is sent to the Microsoft.Storage resource provider:

PUT
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/mystorageaccount?api-version=2019-04-01
REQUEST BODY
{
  "location": "westus",
  "sku": {
    "name": "Standard_LRS"
  },
  "kind": "StorageV2",
  "properties": {}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published