Getting Started
What is chant?
Section titled “What is chant?”Chant is a TypeScript-to-JSON compiler for Azure ARM templates. You write typed TypeScript declarations, and chant outputs deployment-ready ARM templates.
Install
Section titled “Install”npm install --save-dev @intentius/chant @intentius/chant-lexicon-azureYour first ARM template
Section titled “Your first ARM template”The fastest path is the StorageAccountSecure composite — one function call that produces a fully configured storage account:
import { StorageAccountSecure } from "@intentius/chant-lexicon-azure";
const { storageAccount } = StorageAccountSecure({ name: "myappstorage01", sku: "Standard_LRS", tags: { environment: "dev" },});
export { storageAccount };Build and deploy:
# Generate ARM template JSONchant build --output dist/template.json
# Validate with Azure CLI (no changes applied)az deployment group validate \ --resource-group my-rg \ --template-file dist/template.json
# Deploy for realaz deployment group create \ --resource-group my-rg \ --template-file dist/template.jsonUsing resource constructors
Section titled “Using resource constructors”Composites are convenient, but you can also use the lower-level resource constructors directly:
import { StorageAccount, Azure } from "@intentius/chant-lexicon-azure";
export const storage = new StorageAccount({ name: "mystorageaccount", location: Azure.ResourceGroupLocation, kind: "StorageV2", sku: { name: "Standard_LRS" }, supportsHttpsTrafficOnly: true, minimumTlsVersion: "TLS1_2",});Default tags
Section titled “Default tags”Apply tags to every taggable resource in your project:
import { defaultTags } from "@intentius/chant-lexicon-azure";
export const tags = defaultTags([ { key: "Project", value: "my-app" }, { key: "Environment", value: "dev" }, { key: "ManagedBy", value: "chant" },]);Init templates
Section titled “Init templates”Start a new project with a template:
# Default — basic storage accountchant init --lexicon azure
# Web app — App Service with managed identitychant init --lexicon azure --template web-app
# AKS cluster — Kubernetes with VNet and ACRchant init --lexicon azure --template aks-clusterNext steps
Section titled “Next steps”- Resources — Learn about resource types and fields
- Composites — Use high-level composites
- Lint Rules — Understand security checks