Trigger Azure DevOps Pipeline from a specific path

Ananay Ojha 91 Reputation points
2024-11-19T19:15:30.8+00:00

I'm trying to deploy an webapp to azure app service using azure devops pipelines, I need it to auto trigger pipeline whenever a files changes in m folder.

But my pipeline doesn't auto triggers ....

As I have a folder named calculator App - Python/ that does not match the regular expression and is not valid for trigger type in azure devops pipeline.

I get error: String does not match the pattern of "^[^/~^: []\]+(/[^/~^: []\]+)*$". for below:

trigger:
   branches:
     include:
     - main
   paths:
     include:
     - calculator App - Python/*

I tried below but it didn't worked :

thought wildcard (*) will catch everything including spaces 🙃

trigger:
   branches:
     include:
     - main
   paths:
     include:
     - calculator*App/*

Also, Apologies I do not know if this the right place for Azure DevOps QnA please guide me - I'm Still learning

Thanks

Ananay

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,952 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 28,726 Reputation points Microsoft Employee
    2024-11-20T00:13:53.2233333+00:00

    Hey @Ananay Ojha

    Try using ' or " around the folder name to escape the spaces, e.g.

    trigger:
       branches:
         include:
         - main
       paths:
         include:
         - "calculator App - Python"/*
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.