Azure / Azure/azure-dev

Layers v2: define behavior for projects with no infrastructure entries

Open
#10,018 0 comments 0 reactions 0 assignees View on GitHub
area/layered-provisioning area/provisioning
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

## Context

A layers v2 project may contain services without declaring any infrastructure:

```yaml
layers:
- name: application
services:
api:
host: containerapp
image: example/api
```

Layers v2 infrastructure is currently flattened into `provisioning.Options.Layers`. When the flattened list is empty, it is indistinguishable from the legacy `infra.layers: []` representation.

Legacy behavior treats an empty `Options.Layers` collection as the single root infrastructure entry. As a result, a layers v2 project with no infrastructure entries may attempt to use the default Bicep provider rather than treating provisioning as a no-op.

It is not yet clear whether a layers v2 project without infrastructure is a supported customer scenario. We should make that decision explicitly and represent it without changing legacy `infra.layers: []` behavior.

## Expected outcome

- Decide whether layers v2 projects may contain zero infrastructure entries.
- If supported, ensure `azd provision`, `azd up`, `azd down`, pipeline configuration, and environment refresh handle them consistently.
- Preserve legacy behavior for `infra.layers: []`.
- Add tests covering the chosen behavior.

Part of #9767

Contributor guide

Open the contributing guide

Research direction

Start with the layers v2 flattening and legacy infra.layers handling, then trace azd provision, azd up, azd down, pipeline configuration, and environment refresh. Decide whether zero infrastructure is supported, represent that distinction without changing legacy behavior, and add tests covering the chosen behavior consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, go
Domain
cli, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.