Getting Started with Templating¶
Dune uses YAML-based templates to define application infrastructure as code. Templates cover both Day 1 (initial provisioning) and Day 2 (ongoing operations).
Day 1 — Provisioning¶
Day 1 templates use a two-tier composition model:
- A Deployment Template (
.dunedpt.yaml) describes the complete application infrastructure - One or more Resource Group Templates (
.dunergt.yaml) define reusable groups of resources
When a user creates a deployment in the Dune portal, they select a Deployment Template, fill in any parameters, and Dune handles the rest.
Day 2 — Operations¶
An Action Template (.duneact.yaml) defines a standalone workflow (e.g., reboot, refresh, patch) that can be assigned to a deployment, resource group, or resource and executed on demand after the infrastructure exists. See Action Template.
Key Concepts¶
Before diving into templates, here are the core Dune concepts you'll encounter:
| Concept | What it is |
|---|---|
| Tenant | Your organization in Dune. All data is isolated per tenant. |
| Collection | A container that groups related deployments (e.g., Dev, Test, Prod of the same app). |
| Deployment | A rolled-out instance of application infrastructure, created from a Deployment Template. |
| Resource Group | A logical grouping of resources within a deployment (e.g., "web servers" or "database servers"). |
| Resource | A single infrastructure resource: a VM, service account, AD group, or Azure resource. |
| Variable | A configuration value that can be set at any level (Tenant, Collection, Deployment, etc.) and is inherited downward. See Variables. |
| Environment | Distinguishes Production from non-Production deployments (Lab, Dev, Test, Int, Uat, Prod). See Environments. |
| Resource Provider | Defines where resources are deployed and how to access the target infrastructure. See Resource Providers. |
How Templates Fit Together¶
Deployment Template (.dunedpt.yaml)
├── parameters ← user fills these in the portal
├── variables ← configuration values
├── resourceGroups
│ ├── Resource Group "web"
│ │ ├── template: webserver (v1.0.0) ← references an RGT
│ │ └── templateParameters ← passes values to the RGT
│ └── Resource Group "db"
│ ├── template: genericsql (v1.0.0) ← references another RGT
│ ├── templateParameters
│ ├── resources ← extra resources appended to the RGT
│ └── postConfig ← tasks after this RG's resources are deployed
└── postConfig ← tasks that run after all resource groups are deployed
ResourceGroup Template (.dunergt.yaml)
├── parameters ← received from the parent Deployment Template
├── resources
│ ├── computeNode ← virtual machines
│ ├── serviceAccount ← AD service accounts
│ ├── rbacResourceGroup ← AD security groups
│ ├── cluster ← failover clusters (WSFC)
│ └── azureResource ← generic Azure resources
└── postConfig ← tasks that run after all resources in this RG are deployed
Editor Setup¶
VSCode¶
Install the redhat.vscode-yaml extension, then add the following to your VSCode settings (settings.json):
{
"yaml.schemas": {
"https://duneframework.com/tooling/schemas/deploymenttemplate.json": [
"*.dunedpt.yaml",
"*.dunedpt.yml"
],
"https://duneframework.com/tooling/schemas/resourcegrouptemplate.json": [
"*.dunergt.yaml",
"*.dunergt.yml"
],
"https://duneframework.com/tooling/schemas/actiontemplate.json": [
"*.duneact.yaml",
"*.duneact.yml"
]
}
}
This gives you auto-completion and validation as you type.
Note
The template should validate against the schema. If you encounter schema issues, open an issue on the service desk.
File Naming and Versioning¶
- File extension determines the template type:
.dunedpt.yamlfor Deployment Templates,.dunergt.yamlfor Resource Group Templates,.duneact.yamlfor Action Templates - Identifier (the
namefield) must be kebab-case: lowercase letters, digits, and hyphens (e.g.,generic-sql,web-server-nginx) - Pattern:
^[0-9a-z]+[0-9a-z-]*[0-9a-z]+$ - Version lives inside the YAML (not in the filename) using semantic versioning:
1.0.0,2.1.3 - One file per template — e.g.,
genericsql.dunergt.yamlcontainsname: genericsqlandversion: 1.0.0 - Templates are referenced by name + version:
template: genericsql,templateVersion: 1.0.0
Your First Template¶
Here's a minimal template that deploys a single Windows VM with Firefox installed.
Deployment Template (singlevm.dunedpt.yaml):
---
schemaVersion: 1
name: singlevm
displayName: Single VM
version: 1.0.0
description: A single Windows VM with Firefox
resourceGroups:
- name: singlevm
displayName: Single VM
template: singlevm
templateVersion: 1.0.0
Resource Group Template (singlevm.dunergt.yaml):
---
schemaVersion: 1
name: singlevm
displayName: Single VM
version: 1.0.0
description: Single Windows Server
resources:
- type: computeNode
computeType: virtualMachine
name: vmsingle
image: win2022
size: standard_d4s_v5
domain: yourdomain.local
config:
- name: package
variables:
name:
- firefox
What happens when this is deployed:
- Dune creates the deployment and resource group
- A Windows Server 2022 VM is provisioned with the specified Azure SKU size
- The VM is joined to
yourdomain.local - Firefox is installed via Chocolatey
What's Next¶
Follow the documentation in order to build up your knowledge:
| Page | What you'll learn |
|---|---|
| Deployment Template | Full .dunedpt.yaml structure, resource group references, deployment order |
| ResourceGroup Template | Full .dunergt.yaml structure, resource definitions, dependencies |
| Resources | |
| ComputeNode | Virtual machines — sizing, disks, aliases, configuration |
| ServiceAccount | Active Directory service accounts |
| RbacResourceGroup | Active Directory security groups |
| Cluster | Windows Server Failover Clusters |
| AzureResource | Generic Azure resources (Key Vault, etc.) |
| Action Template | Standalone post-deployment workflows (.duneact.yaml) |
| Config Tasks | Built-in configuration tasks (packages, firewall, SQL Server, etc.) |
| Expressions | The {{...}} expression language for dynamic values |
| Parameters | Template parameters — types, validation, defaults |
| Best Practices | Naming conventions, composition patterns, variable strategy |
| Examples | Complete end-to-end examples from simple to complex |