> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/azure-pipelines/adding-analysis-to-build-pipeline/monorepo-projects.md).

# Monorepo projects

Use these instructions to set up your build pipeline in Azure DevOps when analyzing monorepo projects in SonarQube Cloud.

You can add the SonarQube Cloud analysis to your Azure build pipeline for a monorepo.

Proceed as follows:

1. If not already done, import your monorepo to create the corresponding projects in SonarQube Cloud: see the [Monorepo support](/sonarqube-cloud/analyzing-source-code/monorepo-support.md) page.
2. For each project, configure your [Analysis parameters](/sonarqube-cloud/analyzing-source-code/analysis-parameters.md).
3. For each project, set up the integration features. See the [Configuring Azure DevOps project binding](/sonarqube-cloud/managing-your-projects/administering-your-projects/devops-platform-integration/azure-devops.md) page for more details.
4. Add the SonarQube Cloud analysis to your YAML pipeline. To do so, see the section corresponding to your project type and use the YAML file example below add analysis to a:
   * [Gradle or Maven project](/sonarqube-cloud/analyzing-source-code/ci-based-analysis/azure-pipelines/adding-analysis-to-build-pipeline/gradle-or-maven-project.md)
   * [.NET project](/sonarqube-cloud/analyzing-source-code/ci-based-analysis/azure-pipelines/adding-analysis-to-build-pipeline/dotnet-project.md)
   * [C family project](/sonarqube-cloud/analyzing-source-code/ci-based-analysis/azure-pipelines/adding-analysis-to-build-pipeline/c-family-project.md)
   * [JS, TS, Go, Python, PHP, etc. project](/sonarqube-cloud/analyzing-source-code/ci-based-analysis/azure-pipelines/adding-analysis-to-build-pipeline/js-ts-go-python-php-project.md)

## Typical YAML file example for a monorepo analysis <a href="#yaml-file-example" id="yaml-file-example"></a>

```yaml
# Template pipeline that build 2 distinct .NET projects, living in 2 separate folders in the repo. We are analyzing them on SonarQube Cloud, each targets a specific SonarQube Cloud project.
 
trigger:
- main # or another name representing your main branch
 
pool:
 vmImage: windows-latest
 
steps:
- task: VisualStudioTestPlatformInstaller@1
 inputs:
   packageFeedSelector: 'nugetOrg'
   versionSelector: 'latestPreRelease'
 
- task: UseDotNet@2
 inputs:
   packageType: 'sdk'
   version: '6.x'
   includePreviewVersions: true
 
- task: NuGetToolInstaller@1
 inputs:
   versionSpec: '5.9.0'
   checkLatest: true
 
- task: DotNetCoreCLI@2
 inputs:
   command: 'restore'
   projects: '**/*.sln'
   feedsToUse: 'select'
 
- task: SonarCloudPrepare@4
 inputs:
   SonarCloud: '<YourSonarqubeServiceEndpoint>'
   scannerMode: 'dotnet'
   projectKey: 'myRepo_myProject1'
 
- task: DotNetCoreCLI@2
 inputs:
   command: 'build'
   projects: 'myproject1/solution.sln'
   arguments: '/nr:false' // this flag is important to avoid DLL lock for the 2nd build/analysis
 
- task: SonarCloudAnalyze@4
 
- task: SonarCloudPrepare@4
 inputs:
   SonarCloud: '<YourSonarqubeServiceEndpoint>'
   scannerMode: 'dotnet'
   projectKey: 'myRepo_myProject2'
 
- task: DotNetCoreCLI@2
 inputs:
   command: 'build'
   projects: 'myProject2/solution.sln'
   arguments: '/nr:false'
 
- task: SonarCloudAnalyze@4
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-cloud/analyzing-source-code/ci-based-analysis/azure-pipelines/adding-analysis-to-build-pipeline/monorepo-projects.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
