Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
402 stars 195 forks source link

[Feature] Don't require azure.yaml #2716

Open jongio opened 1 year ago

jongio commented 1 year ago

We have projects that utilize azd only for azure infra and not source. In that case the azure.yaml file is empty, but still required by azd.

It would be nice if azure.yaml wasn't required to minimize the number of files I need to tell people to create for this scenario.

weikanglim commented 1 year ago

I would love to see us move towards this direction simply because it allows azd to be more useful as a tool, rather than something that requires heavyweight onboarding.

If we do go down this path, this translates to: azd primitives like provision should be less coupled to the project file and be more lightweight. This is currently in-disagreement with future plans we may have like:

There are also technical architectural limitations we've introduced by recent introduction of DI (which has really coupled things at the application initialization layer) in azd:

vhvb1989 commented 1 year ago

azure.yaml is also used by VSCode-ext to discover azd-projects.

azure.yaml is empty for infra-only projects ONLY when projects are following the azd-convention of having the infra files within a folder named infra and with a file called main.bicep.

Azd could try to see if this convention exists on current directory (even when there's no azure.yaml) and if yes, azd can create the empty azure.yaml which would enable the VSCode-ext to detect the project and activate.

ellismg commented 1 year ago

Today, in addition to providing configuration information, we use the existence azure.yaml to define where the root of the azd project is, and lots of paths are built off that assumption.

We could move to using the .azure folder for this, instead. I suspect in a world where azure.yaml doesn't exist, the default value for the project name will be the name of the folder that .azure ends up in.

azure.yaml is also used by VSCode-ext to discover azd-projects.

I feel like if we do the above, we could update the extension to also use the strategy of detecting .azure instead. We'd also have to look at VS.

vhvb1989 commented 1 year ago

.azure folder is created at the same time that azure.yaml file. This is after running azd init with the Minimal selection.

I think what @jongio is looking for here is a way to use azd without calling azd init first. A way where folks can just create an infra folder with a main.bicep file in it and then run azd up or azd provision right away. In this case, folks would still need to manually create a .azure folder.. which might not be better than running azd init

The way I see it, we just need to make azd to automatically run azd init with the Minimal selection if it detects the azd-infra-convention (infra folder + main.bicep)

savannahostrowski commented 1 year ago

I think this would require some considerable thought. IMO, there are some UX implications of making this optional that also may make azd feel more magical. I'd want to think through the scenarios we think we are improving and understand if the inclusion of an azure.yaml is really the hurdle here.