Use Control Option of a task to run only when the pipeline is triggered from specific folder which is mapped in CI-Triggers Path Filters · Issue #13177 · MicrosoftDocs/azure-devops-docs · GitHub
Classic release triggers for stages, branches, and pipelines - Azure Pipelines | Microsoft Learn
Trigger an Azure DevOps pipeline with a comment when a path filter is defined - Stack Overflow