我们在 Azure Dev 中使用什么是每个解决方案的项目或管道

What do we use in Azure Dev a project or pipelines per solution

需要有关 Azure 管道的帮助。只是测试它并考虑从 TeamCity 迁移到 Azure Dev 并且想知道:

我有:

1. Asp.Net Core Web Api (Web1)
2. Asp.Net Core Web Api (Web2) 
3. WPF App
4. Several infrastructure class libraries that are shared libs between the above 3 solutions (Web1, Web2, WPF).

我是否创建了 4 个 azure 项目?

1 project that includes the repository of Web1 project with 1 pipeline that nuget restores, builds and publish artifacts 
1 project that includes the repository of Web1 project with 1 pipeline that nuget restores, builds and publish artifacts 
1 project that includes the repository of WPF App with 1 pipeline that nuget restores, builds and publish artifacts 
1 project that includes all repositories of all class libs and for each library I create a pipeline

或者我为所有人创建一个项目并为每个项目添加一个管道(web1、web2、wpf 应用程序和 class 库)

写评论作为答案,以便我们可以关闭问题。

这些 .NET 项目是否位于不同的 git 存储库中?您的 git 工具 Github 还是 Azure Devops 存储库?

我个人使用projects来分隔不同的逻辑项目(开发团队)和同一个项目内的不同流水线,用于团队的不同项目。

例如团队 A 可以有 4 个项目,我会选择一个 DevOps 项目和其中的 4 个管道。团队 B 将有一个单独的项目等

共享库可以像不同项目一样处理。您可以构建它们并通过 nuget 上的任务上传它们。如果它们应该包含在项目中,那么您的 web1、web2 和 wpf 项目中应该已经存在,因此将执行 msbuild 和 nuget restore 的管道也将处理这些库。

如果您不想针对特定人员取消某些项目,那么我会选择 一个 DevOps 项目和 不同 管道每个图书馆项目。

通常,您将管道与 git 集线器存储库结合使用。因此,如果您的所有库都放在一个 git 中心存储库中,您将使用一个管道,否则您必须在同一个 Azure Devops 项目中创建多个管道。

总的来说我主要使用的方法:

Different Azure DevOps projects -> Different dev teams.
Projects inside one dev team -> Different pipelines inside the project.
Different github repositories -> Different pipelines for each one (exceptions apply here but in most cases it is a practice)