Sign in during Public Preview to get the Team plan free, plus an early-adopter discount when we launch. Sign in
ARM Templates are JSON files that describe the Azure infrastructure you want to deploy. You can deploy ARM Templates against Locally either by using the locally deploy command (which generates a resource group/deployment name, if unspecified, and deploys into the first subscription alphabetically by default) or by using the same commands you would with the Azure CLI (see below).
Every ARM Template targets a scope - a Resource Group (the default), a Subscription, a Management Group or a Tenant.
Most templates deploy into a Resource Group. For example, this template creates an Availability Set:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Compute/availabilitySets",
"apiVersion": "2024-11-01",
"name": "example-from-armtemplate",
"location": "berlin",
"properties": {
"platformFaultDomainCount": 3,
"platformUpdateDomainCount": 5
},
"sku": {
"name": "Aligned"
}
}
]
}
If Locally isn't already running, we'll need to start it by running:
$
locally build
Then, if the template's saved as template.json, you can deploy it with:
$
locally deploy template.json
If you don't specify a Subscription, the first Subscription alphabetically will be used, and if you don't specify a name for the Resource Group or Deployment then one will be randomly generated as needed. You can specify these values by setting:
--subscription {UUID} - the Subscription to deploy into. Defaults to the First Subscription.
--resource-group {name} - the Resource Group to deploy into, which is created if it doesn't already exist.
--deployment {name} - the name to record the Deployment under.
--parameters {file} - a parameters file (.json).
For example, to deploy into a Resource Group named dev in a specific Subscription:
$
locally deploy --subscription 9fae9a7d-5fd4-4b18-8efc-22ac8eb6eaaa --resource-group dev template.json
To deploy at the Subscription scope instead, use the Subscription deployment template $schema. This one creates a Resource Group:
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"apiVersion": "2021-04-01",
"name": "from-subscription-deployment",
"location": "berlin"
}
]
}
Subscription deployments also take a --location flag, which sets where the Deployment's metadata is stored and defaults to berlin:
$
locally deploy --location berlin subscription-template.json
The --subscription, --deployment and --parameters flags work the same way as for Resource Group deployments, but --resource-group doesn't apply at this scope.
Locally doesn't support Management Group or Tenant scoped deployments at this time, but we plan to in the future. We're tracking this feature request in this issue on the Locally Issue tracker.
If you'd rather use the Azure CLI, prefix az deployment group create with locally run to deploy an ARM Template into an existing Resource Group:
$
locally run az deployment group create --resource-group example --template-file template.json
You can see what you've deployed in the Locally Dashboard, and the Examples include ARM Templates for many common resources. If you'd rather write Bicep, see the Bicep guide.
Sign in during Public Preview to get the Team plan free, plus an early-adopter discount when we launch. Sign in
Your Azure infrastructure, running on your machine. Deploy in seconds, break things freely, and ship to Azure when you're ready.