azure-dev icon indicating copy to clipboard operation
azure-dev copied to clipboard

[Issue] azd pipeline config requires a github/workflows folder in the projects folder

Open christiannagel opened this issue 11 months ago • 5 comments

I would expect to require a .github/workflows folder in the root directory of the repository, not in the projects folder.

I have a github repository with this structure:

  • .github/workflows
  • src/

.github/workflows contains a github action src contains a .NET Aspire project with a solution file, the AppHost, and other projects

After initializing the project with azd init, using azd pipeline config from the src folder fails with:

Error: no CI/CD provider configuration found. Expecting either github and/or azdo folder in the project root directory.

Starting azd pipeline config from the root folder of the project with the --cwd option passing the src folder fails with the same error.

Creating a .github directory in the src folder (as the error message says) fails as well.

Having a .github/workflows folder in the src folder (where a GitHub Action workflow will not run), the command azd pipeline config succeeds.

I wouldn't expect the need to have a .github/workflows folder in the folder of the solution when GitHub does not use this.

Versions: azd version 1.7.0 (commit 49d6adc2efb178083f61822e6b4715258560803d) aspire 8.0.0-preview.5.24170.4/8.0.100 SDK 8.0.200

christiannagel avatar Mar 22 '24 20:03 christiannagel

Hi @christiannagel

Ideally, you should be able to run azd init and then azd pipeline config from the root of your project. azd auto-detects the netAspire project within src

vhvb1989 avatar Mar 24 '24 18:03 vhvb1989

I created this issue to give you an alternative: https://github.com/Azure/azure-dev/issues/3587

vhvb1989 avatar Mar 24 '24 18:03 vhvb1989

@vhvb1989 azd init from the root of the repository is not ideal: with https://github.com/PacktPublishing/Pragmatic-Microservices-with-CSharp-and-Azure I have a .NET Aspire project in every chapter folder.

Thanks for the alternative #3587 :-)

christiannagel avatar Mar 24 '24 19:03 christiannagel

That's an interesting approach, @christiannagel , having multiple projects per folder. Are all of the projects part of the same micro-services solution? or are they each independent one to another?

You might want to follow this issue: https://github.com/Azure/azure-dev/issues/3563 where azd would still run from the root, but it would ask you which project to deploy. Ideally, by having azd on the root, it would allow you to run azd up to have each project/folder deployed to Azure.

OTOH, if each folder is independent (like a collection of samples living all in the same repo), you might want to explore splitting each folder into one repo, and setting up a tool like repo man to auto-create each repo from one a source-repo.

vhvb1989 avatar Mar 24 '24 19:03 vhvb1989

@vhvb1989 https://github.com/PacktPublishing/Pragmatic-Microservices-with-CSharp-and-Azure is the repo for an upcoming book. Every chapter folder has a complete solution, which is continued and enhanced in the folder of the next chapter.

The complete solution (not only the backend but also client applications) is in this organization: https://github.com/codebreakerapp/

One repo for the complete backend (https://github.com/CodebreakerApp/Codebreaker.Backend), a repo for all XAML clients, a repo for Blazor.

Originally, I had a mono-repo for the backend and the clients, but this was changed before .NET Aspire was announced. Now I plan to add a submodules to the backend repo, e.g. for Blazor to include Blazor with the .NET Aspire application (unless .NET Aspire supports referencing other repos earlier).

christiannagel avatar Mar 24 '24 19:03 christiannagel