azure.yaml Schema

July 31, 2026 · View on GitHub

The azure.yaml file is the project configuration file for the Azure Developer CLI. It lives at the root of your project and declares services, infrastructure, and lifecycle hooks.

Overview

name: my-project
metadata:
  template: my-org/my-template
services:
  web:
    project: ./src/web
    language: js
    host: appservice
  api:
    project: ./src/api
    language: python
    host: containerapp

Top-Level Properties

PropertyTypeDescription
namestringRequired. Project name used for resource naming
metadataobjectTemplate metadata (origin template, version)
resourceGroupstringOverride the default resource group name
servicesmapService definitions keyed by service name
pipelineobjectCI/CD pipeline configuration
hooksmapProject-level lifecycle hooks
infraobjectInfrastructure provider configuration
stateobjectRemote state backend configuration
resourcesmapAzure resource definitions
requiredVersionsobjectVersion constraints for azd and extensions
platformobjectPlatform-specific configuration
workflowsobjectWorkflow configuration
cloudobjectCloud environment configuration

Service Properties

PropertyTypeDescription
projectstringRelative path to the service source directory
languagestringService language (dotnet, csharp, fsharp, py, js, ts, java, docker, custom)
hoststringRequired. Hosting target (appservice, containerapp, function, staticwebapp, aks, etc.)
modulestringBicep module path for the service's infrastructure
hooksmapService-level lifecycle hooks
dockerobjectDocker build configuration
imagestringContainer image (alternative to project for pre-built images)
diststringPath to pre-built distribution directory
resourceNamestringOverride the Azure resource name
k8sobjectKubernetes-specific configuration
configobjectService-specific configuration
resourceGroupstringOverride the resource group for this service
apiVersionstringAPI version for the hosting target
envmapEnvironment variables passed to the service
useslistService dependencies
remoteBuildbooleanEnable remote build for code-based Azure Functions

Hooks

Hooks run user-defined scripts at lifecycle points:

hooks:
  preprovision:
    kind: sh
    run: ./scripts/setup.sh
  postdeploy:
    kind: sh
    run: ./scripts/smoke-test.sh

Available hook points (each supports pre and post prefixes):

  • Command hooks (project-level): build, deploy, down, package, provision, publish, restore, up
  • Service lifecycle hooks (service-level): restore, build, package, publish, deploy

For example, preprovision runs before provisioning, postdeploy runs after deployment. Service-level hooks are defined under a service's hooks section in azure.yaml and apply only to that service.

JSON Schema

The full JSON schema for azure.yaml is maintained in the schemas/ directory and published for editor validation.

Host-Specific Notes

App Service (host: appservice)

App Service supports two deployment modes:

  • Zip deploy (default): When language is set to a non-Docker language (e.g., python, js, dotnet), azd builds the code, creates a zip archive, and deploys it via the Kudu zip deploy API.
  • Container deploy: When language: docker is set, azd builds the container image, pushes it to ACR, and updates the site's linuxFxVersion. Currently Linux App Service only. Your infrastructure (bicep/terraform) must configure ACR access (e.g., managed identity ACR pull, identity assignment) before deploying. azd only updates the image reference at deploy time.

Note: Container deployment supports both language: docker (with a Dockerfile) and polyglot containerization (e.g., language: python with docker.path pointing to a Dockerfile). You can also use a pre-built image: without local source.

Example container deployment:

services:
  web:
    project: ./src/web
    language: docker
    host: appservice
    docker:
      path: ./Dockerfile

Function App (host: function)

Function Apps support code and container deployment:

  • Zip deploy (default): When no container configuration is present, azd builds the Function project, creates a zip archive, and deploys it through the Function App deployment API. The top-level remoteBuild property applies only to this mode.
  • Container deploy: Configure language: docker, set docker.path for a non-Docker language, or provide a pre-built image. azd builds or resolves the image, publishes it to ACR when needed, and updates the Function App's linuxFxVersion.

Container-based Function infrastructure must configure a Linux Function App, an initial DOCKER| image reference, and registry pull access before deployment. These settings remain the responsibility of Bicep or Terraform. If the provisioned Function App and the service disagree about the deployment mode, azd fails before attempting an incompatible upload and identifies the configuration mismatch.

Unlike App Service, Function Apps always deploy to the main site. Deployment slots are not part of the Function App workflow, so AZD_DEPLOY_{SERVICE}_SLOT_NAME has no effect and azd never prompts for a slot.

Example TypeScript container deployment:

services:
  function:
    project: ./src/function
    language: ts
    host: function
    docker:
      path: ./Dockerfile

See Also