Azure / Azure/azure-dev

Let azure.yaml reference an external project and have an extension translate it

Open
#9,839 0 comments 0 reactions 1 assignee Claimed by @vhvb1989 View on GitHub
area/extensions enhancement
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

`azure.yaml` has to describe your whole app itself. Anything your project already knows about itself gets copied into `azure.yaml` by hand, and then the two drift.

Right now a service entry wants a path, a host from a fixed set, and a language from a fixed set, and `resources` has a closed list of 14 types. If the truth about your app lives somewhere else (a project file, a framework config, an internal platform's manifest) you have two choices. Flatten it into our vocabulary and maintain it in two places forever, or don't use `azure.yaml` for it. Neither is good, and the first one is worse than it looks because the copy is only correct on the day someone wrote it.

What I want instead is to point at it:

```yaml
services:
api:
project: ./src/api
provider: mycompany.platform
```

We load that, ask the named extension what's there, and it hands back services and infrastructure. The user never writes down what we could have asked for. This is the step where people stop describing their app to us and start pointing at it, and I think it's the single biggest reduction in "stuff you have to write for Azure" available to us.

Things that need to be right:

- There has to be a way to turn it into real text. If translated services and infra only ever exist in memory, we've made the whole thing opaque and unfixable, which is the same complaint I have about anything magic. "Show me what you translated, as `azure.yaml` and infra I own and can edit" needs to ship with this, not after it.
- I'm worried about determinism. If the same repo translates differently depending on which extensions are installed, or on what a network call returned that morning, then `azd up` isn't reproducible on a colleague's machine or in CI. A reference needs to pin the extension and its version.
- Cost. If figuring out whether an extension can handle a path means launching that extension, then startup cost scales with how many extensions you have installed, on every single command. Extensions should declare cheap match criteria we can evaluate first, and we only pay for a process when something plausibly matches.
- Anything the user wrote by hand wins over anything we translated, and we should say out loud (or error) when we dropped a translated value because an explicit one was already there.

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.