exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 17 question 1 discussion

Actual exam question from Microsoft's AZ-400
Question #: 1
Topic #: 17
[All AZ-400 Questions]

HOTSPOT -
How should you configure the filters for the Project5 trigger? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: branch filter to exclude -
Scenario:

Continuous integration (CI) triggers cause a build to run whenever a push is made to the specified branches or a specified tag is pushed.

Box 2: branch filter to include -
You can specify branches to include and exclude. For example:
# specific branch build
trigger:
branches:
include:
- master
- releases/*
exclude:
- releases/old*
Reference:
https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Kazillius
Highly Voted 3 years, 4 months ago
I think it's -Path filter to exclude -Path filter to include Because '/.' is not the name of a branch. Check this example: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml#wildcards
upvoted 72 times
rdemontis
2 years, 7 months ago
totally agree with you https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml#ci-triggers
upvoted 1 times
...
Kosky
3 years, 3 months ago
I think you are right. https://mohitgoyal.co/2018/09/19/using-path-filters-in-build-definition-in-azure-devops-vsts/ "To properly specify an exclusion path, we need to also define an inclusion path. It may be something specific like /teraVis (in our case) or just root i.e. /"
upvoted 2 times
pdk88
2 years, 2 months ago
I think you are right as explained in the article you cited (https://mohitgoyal.co/2018/09/19/using-path-filters-in-build-definition-in-azure-devops-vsts/), so the answer must be -Path filter to exclude /folder1 -Path filter to include / Although a branchfilter is needed when using a pathfilter, "/" is not a valid branchefilter. A branchefilter must be something like "main" or "develop", etc. "When you specify paths, you must explicitly specify branches to trigger on. You can't trigger a pipeline with only a path filter; you must also have a branch filter, and the changed files that match the path filter must be from a branch that matches the branch filter." https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml#paths
upvoted 3 times
...
...
TrangNguyen_6
3 years, 4 months ago
you are right
upvoted 2 times
...
...
lugospod
Highly Voted 2 years, 9 months ago
Got this January 2022. path Exclude, include. 100% on that part.
upvoted 16 times
...
vsvaid
Most Recent 10 months, 3 weeks ago
-Path filter to exclude -Path filter to include
upvoted 4 times
...
vsvaid
11 months ago
Correct answer
upvoted 1 times
...
yana_b
1 year, 3 months ago
Correct answers are: Path filter to exclude Branch filter to include https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers -> right under Paths title -> When you specify paths, you must explicitly specify branches to trigger on if you are using Azure DevOps Server 2019.1 or lower. You can't trigger a pipeline with only a path filter; you must also have a branch filter, and the changed files that match the path filter must be from a branch that matches the branch filter. If you are using Azure DevOps Server 2020 or newer, you can omit branches to filter on all branches in conjunction with the path filter.
upvoted 2 times
...
zellck
1 year, 5 months ago
Same as Topic 11 Question 1. https://www.examtopics.com/discussions/microsoft/view/20737-exam-az-400-topic-11-question-1-discussion
upvoted 3 times
...
Fal991l
1 year, 7 months ago
GPT-4: 1. Set a path filter to exclude `/folder1` (option c): A path filter allows you to specify which files or folders in your repository should trigger a build when they are changed. In this case, setting a path filter to exclude `/folder1` will prevent changes within `/folder1` of the repository from triggering a build. 2. Set a branch filter to include `/` (option b): A branch filter allows you to specify which branches in your repository should trigger a build when they are changed. In this case, setting a branch filter to include `/` will allow changes in any branch of the repository to trigger a build. These two actions will configure the continuous integration trigger for Project4 to initiate a build in response to any change in the repository except for changes within `/folder1` of the repository.
upvoted 2 times
...
syu31svc
2 years, 3 months ago
I would agree with the given answer Branch filter to include / would include all code from triggering a build Path filter to exclude /folder 1 for first drop down is correct to address 'except for changes in /folder 1"
upvoted 2 times
...
Eltooth
2 years, 6 months ago
-Path filter to exclude -Path filter to include
upvoted 2 times
...
Mev4953
2 years, 9 months ago
I would go for -Path filter exclude -Path filter include If you exclude a path, you cannot also include it unless you qualify it to a deeper folder. For example if you exclude /tools then you could include /tools/trigger-runs-on-these https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml#:~:text=If%20you%20exclude%20a%20path%2C%20you%20cannot%20also%20include%20it%20unless%20you%20qualify%20it%20to%20a%20deeper%20folder.%20For%20example%20if%20you%20exclude%20/tools%20then%20you%20could%20include%20/tools/trigger%2Druns%2Don%2Dthese
upvoted 3 times
...
Sara_Mo
2 years, 10 months ago
-Path filter to exclude -Path filter to include
upvoted 2 times
...
celciuz
3 years, 2 months ago
This question came out in August 2021
upvoted 5 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...