Skip to content

Resources

Every Azure resource has a type in the format Microsoft.{Provider}/{ResourceType}. The lexicon generates a TypeScript class for each type.

import { StorageAccount, VirtualMachine, WebApp } from "@intentius/chant-lexicon-azure";

Common resource types:

TypeClassDescription
Microsoft.Storage/storageAccountsStorageAccountBlob, file, queue, table storage
Microsoft.Compute/virtualMachinesVirtualMachineIaaS virtual machines
Microsoft.Web/sitesWebAppApp Service web applications
Microsoft.Web/serverfarmsAppServicePlanApp Service plans
Microsoft.Network/virtualNetworksVirtualNetworkVirtual networks
Microsoft.Network/networkSecurityGroupsNetworkSecurityGroupFirewall rules
Microsoft.ContainerService/managedClustersManagedClusterAKS Kubernetes clusters
Microsoft.KeyVault/vaultsKeyVaultSecret and key management
Microsoft.Sql/serversSqlServerAzure SQL logical servers
Microsoft.ContainerRegistry/registriesContainerRegistryDocker container registries

ARM templates have fields that sit at the resource level (outside properties):

The pricing tier or capability level:

export const storage = new StorageAccount({
sku: { name: "Standard_GRS" },
});

Disambiguates resource subtypes:

export const storage = new StorageAccount({
kind: "StorageV2", // or "BlobStorage", "BlockBlobStorage"
});

Managed identity configuration:

export const app = new WebApp({
identity: { type: "SystemAssigned" },
});

Key-value metadata:

export const storage = new StorageAccount({
tags: { environment: "production", team: "platform" },
});

Availability zone placement:

export const vm = new VirtualMachine({
zones: ["1"],
});

Marketplace plan information:

export const vm = new VirtualMachine({
plan: {
name: "my-plan",
publisher: "my-publisher",
product: "my-product",
},
});

Azure region. Defaults to [resourceGroup().location]:

import { Azure } from "@intentius/chant-lexicon-azure";
export const storage = new StorageAccount({
location: Azure.ResourceGroupLocation, // default
// or: location: "eastus2",
});

Every ARM resource requires an apiVersion — the serializer injects the latest stable version automatically. You typically never set this manually.

The post-synth checks AZR011 and AZR012 validate:

  • AZR011: apiVersion exists and follows YYYY-MM-DD format
  • AZR012: apiVersion is not outdated (older than 2023-01-01)