Skip to content

Getting Started

Chant is a TypeScript-to-JSON compiler for Azure ARM templates. You write typed TypeScript declarations, and chant outputs deployment-ready ARM templates.

Terminal window
npm install --save-dev @intentius/chant @intentius/chant-lexicon-azure

The fastest path is the StorageAccountSecure composite — one function call that produces a fully configured storage account:

src/main.ts
import { StorageAccountSecure } from "@intentius/chant-lexicon-azure";
const { storageAccount } = StorageAccountSecure({
name: "myappstorage01",
sku: "Standard_LRS",
tags: { environment: "dev" },
});
export { storageAccount };

Build and deploy:

Terminal window
# Generate ARM template JSON
chant 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 real
az deployment group create \
--resource-group my-rg \
--template-file dist/template.json

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",
});

Apply tags to every taggable resource in your project:

src/tags.ts
import { defaultTags } from "@intentius/chant-lexicon-azure";
export const tags = defaultTags([
{ key: "Project", value: "my-app" },
{ key: "Environment", value: "dev" },
{ key: "ManagedBy", value: "chant" },
]);

Start a new project with a template:

Terminal window
# Default — basic storage account
chant init --lexicon azure
# Web app — App Service with managed identity
chant init --lexicon azure --template web-app
# AKS cluster — Kubernetes with VNet and ACR
chant init --lexicon azure --template aks-cluster