Azure / Azure/azure-dev

[layers v2] Spike — full micro-templates: merge a complete azd template into an existing project

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

Description

Part of #9765.

Add in `azd add -t -p --layer ` command, which lets you merge an entire azd template's `azure.yaml` into a project's existing `azure.yaml`. This is the core workflow for a true micro-template — an entire azd project, imported into an existing one.

- Do we need a new file format, or is it enough to layer in merge guidelines on top of the existing schema? Different `azure.yaml` keys need different merge treatment (additive/namespaced, project-level singleton, "merge with care", or flatly incompatible).
- We want to avoid getting to "npm" levels of complexity (@vhvb1989 brought this up — what happens if you have templates that depend on templates, etc.). It can spiral, fast, so we need to set some guidelines here.
- We want to support importing a template by reference, not just vendoring the whole thing. This opens up a mode where a customer can just receive updates for a template instead of managing it themselves.
- Known complications:
- `services[].config` is an opaque, extension-owned blob (`additionalProperties: true`) — it either comes over wholesale, or we don't bring it over.
- Also needs to relocate `metadata.template` from the project level down to the layer level, since a project will eventually be assembled from several templates that each move independently, not just one.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.