Infrastructure as code (IaC) means describing cloud resources in declarative files instead of creating them by hand. On Azure, the native options are ARM templates (JSON documents consumed by Azure Resource Manager, the platform's deployment engine) and Bicep (a cleaner language that compiles to ARM templates — same engine, far more readable). For Claude on Microsoft Foundry, IaC buys you three things enterprises care about: identical dev/staging/production environments, a reviewable audit trail of every infrastructure change, and fast rebuilds when you need a new region or a disaster-recovery copy.
What a Claude-on-Foundry template needs to express
Foundry uses a two-level hierarchy, and your templates should mirror it: a Foundry resource carries security and billing configuration, and one or more deployments inside it are the model instances your applications call. The decisions you make in the portal are exactly the decisions to encode as template parameters:
- Resource region. The resource must live in a supported region — Global Standard deployments are documented in East US2 and Sweden Central — or deployments will fail with a "Region not available" error.
- Deployment name. Defaults to the model ID (e.g.
claude-opus-4-8), customizable, and immutable after creation. It is also the value applications pass as themodelparameter, so treat it as part of your public interface and choose a naming convention deliberately (see model version pinning). - Deployment type and hosting version. Global Standard versus Data Zone Standard (US), and Hosted on Azure (model version 2) versus Hosted on Anthropic infrastructure (version 1). These change data-processing boundaries and feature availability, so they belong in reviewed code, not in someone's memory of a portal session.
- Networking. Foundry resources support Azure Private Link — public network access settings and private endpoints can be configured at resource creation, which is naturally expressed in a template alongside the resource itself.
The marketplace wrinkle
Claude models in Foundry are third-party Azure Marketplace offerings from Anthropic, and using them requires an Azure Marketplace subscription plus acceptance of the offer terms — in the portal flow, that acceptance happens during "Deploy > Custom settings". When automating, plan for this step: marketplace terms acceptance is an account-level action that your pipeline or a one-time bootstrap must handle before template deployments succeed. Prerequisites from the portal flow apply equally to pipelines: a paid Azure subscription (free trial and credit-only subscriptions are not supported for Claude) and Contributor or Owner on the target resource group for the identity running the deployment.
Start from the official starter kit
Rather than authoring templates from scratch, start with the Claude on Foundry starter kit (github.com/Azure-Samples/claude), referenced from Microsoft's own documentation. It provisions a Foundry account, project, and Claude deployments with a single azd up — the Azure Developer CLI command that deploys an application template — and offers both Bicep and Terraform variants. Notably, it wires the Anthropic SDK and Claude Code CLI to authenticate with Microsoft Entra ID, so no API keys need to be generated, stored, or rotated. Reading its Bicep files is the fastest way to learn the exact resource types and API versions Microsoft currently uses for Claude deployments — details we deliberately do not reproduce here, since official schemas evolve and the kit is kept current.
Pipeline practices that pay off
- Validate before deploying. Use ARM's what-if capability to preview changes in pull requests, so a reviewer sees "this changes the deployment's model" before it happens.
- One parameter file per environment, same template everywhere — the only diffs between staging and production should be parameter values.
- Deployments are cheap; resources hold config. Model upgrades are new deployments plus an app-config change, which fits IaC review flows perfectly.
- Remember quota is not IaC-managed. Rate-limit quota lives at the subscription level and increases go through Microsoft's request form — provisioning a deployment does not provision capacity.
Where to go next
If your team standardizes on Terraform instead, see managing Foundry resources with Terraform. For the manual baseline the templates automate, read Foundry resource setup and model deployments.