Skip to content

Error deploying IaC with Terraform and layers #8126

Description

@rliberoff

Output from azd version
azd version 1.25.0 (commit 208a518) (stable)

Describe the bug
Using Terraform as IaC with layered infrastructure throws the following error when executing azd up. The error message is:

ERROR: analyzing layer dependencies: extracting outputs for layer "backend": reading F:\repos\work\...\demo-hub\demos\agents-demo\infra\backend\main.bicep: open F:\repos\work\...\demo-hub\demos\agents-demo\infra\backend\main.bicep: The system cannot find the file specified.

There is no main.bicep. All the IaC is Terraform.

To Reproduce
Create a simple Terraform IaC to deploy a remote backend and a simple infrastructure. Then create a azure.yaml as follows:

name: agents-demo

services:
  genie-agent:
    project: ./src/Demo.Agent
    language: csharp
    host: containerapp
    resourceGroup: ${AZURE_RESOURCE_GROUP}
    resourceName: ${AZURE_CONTAINER_APP_NAME}
    docker:
      registry: ${AZURE_CONTAINER_REGISTRY_ENDPOINT}

infra:
  layers:
    - name: backend
      path: ./infra/backend
      provider: terraform
    - name: resources
      path: ./infra/resources
      provider: terraform
      dependsOn:
        - backend

Expected behavior
Both the backend hosting the storage account and blob container for Terraform remote state, and the resources with the infrastructure of the project are deployed with azd up.

Environment
Information on your environment:
* Terraform v1.15.2
* C# 14 and .NET 10
* VS Code Insiders

Metadata

Metadata

Assignees

Labels

Type

Fields

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions