exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 5 question 25 discussion

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

You have a GitHub repository that contains multiple versions of an Azure Pipelines template.

You plan to deploy multiple pipelines that will use a template stored in the repository.

You need to ensure that you use a fixed version of the template.

What should you use to reference which version of the template repository to use?

  • A. the serial
  • B. the SHA-based hashes
  • C. the runner
  • D. the branch
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
Wengatz
Highly Voted 2 years, 6 months ago
Selected Answer: D
Answer is correct: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#use-other-repositories If you want to use a particular, fixed version of the template, be sure to pin to a ref. The refs are either branches (refs/heads/<name>) or tags (refs/tags/<name>). If you want to pin a specific commit, first create a tag pointing to that commit, then pin to that tag.
upvoted 19 times
Freyr
6 months, 2 weeks ago
Correct Answer: D SHA-based hashes (B) provide the most immutable reference to a specific version, however the official Microsoft documentation explicitly recommends using refs (branches or tags) for fixing template versions: From the above reference link: "If you want to use a particular, fixed version of the template, be sure to pin to a ref. The refs are either branches (refs/heads/<name>) or tags (refs/tags/<name>)." Therefore, D (the branch) is the technically correct answer according to Microsoft's official guidance, even though SHA-based hashes would also work. yaml would look like this: yamlCopyresources: repositories: - repository: templates type: github name: org/repo ref: refs/heads/release-1.0 # Branch reference 1. Using a branch reference is the recommended approach per Microsoft 2. Using tags (which are a type of ref) is particularly good for version control 3. SHA hashes, while perfectly functional, are not the primary recommended method
upvoted 3 times
...
...
resonant
Highly Voted 2 years ago
Selected Answer: B
The question asks for a *fixed version* of the template. If you use the main branch for instance, which is a branch that usually points to the latest version, then you are not using a fixed version because it changes over time as commits are made. Its like using the latest version of a software. Today the latest version might be 1.32.2 but next year it could be 4.17.5 . Tags would be a valid answer since they are used to denote a specific version and point to a specific commit, but branches are not. You don't have tags as an available answer but the SHA should do because the SHA is the identifier of a specific commit.
upvoted 10 times
resonant
2 years ago
I just read the link that @Wengatz provided and even though I still think the correct answer should be the SHA, if I found this question in the exam I'd choose D because that's literally what the Microsoft's documentation says.
upvoted 4 times
...
...
SunnyIOM
Most Recent 3 months, 3 weeks ago
Selected Answer: B
SHA-based hashes: Each commit in a GitHub repository is identified by a unique SHA-1 hash. By referencing the SHA-based hash of a specific commit, you can ensure that your pipeline uses the exact version of the template from that commit. This is the most reliable way to lock in a specific version of the template, as it is immutable and will not change over time.
upvoted 1 times
...
learningCat
5 months, 3 weeks ago
Selected Answer: B
Why not D, here is the answer from Gemini : While you could reference a branch, branches are mutable. If the branch is updated, your pipeline will use the latest version of the template on that branch, which might not be what you intend. This makes your pipeline deployments unpredictable. You want to lock in a specific version, and branches can change.
upvoted 1 times
...
Christian_garcia_martin
6 months, 2 weeks ago
Selected Answer: B
SHA-based hashes
upvoted 1 times
...
Aimen
6 months, 4 weeks ago
Selected Answer: B
Should be B. https://learn.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops&pivots=templates-includes#use-other-repositories "You can also pin to a specific commit in Git with the SHA value for a repository resource. The SHA value is a 40-character checksum hash that uniquely identifies the commit."
upvoted 2 times
...
Gooldmember
8 months, 3 weeks ago
Selected Answer: D
Agree with D https://learn.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#use-other-repositories
upvoted 1 times
...
Mattt
10 months ago
Selected Answer: B
I go with SHA hashes
upvoted 2 times
...
UrbanRellik
1 year ago
Selected Answer: B
I'm here just to adjust the voting % in favor of B. You would use SHA-based hashes to identify a fixed version of the template. Using a branch is not going to lock you into a fixed version of the template.
upvoted 2 times
...
5c3d677
1 year, 1 month ago
Selected Answer: D
By using SHA-based hashes, you're locking your pipelines to a specific, immutable version of the template, which is the most reliable way to ensure consistency across multiple pipeline deployments.
upvoted 1 times
...
DrSohan93
1 year, 4 months ago
https://learn.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops&pivots=templates-includes#use-other-repositories "You can also pin to a specific commit in Git with the SHA value for a repository resource. The SHA value is a 40-character checksum hash that uniquely identifies the commit."
upvoted 3 times
...
freddyneen
1 year, 6 months ago
Selected Answer: B
From link: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/templates?view=azure-devops#use-other-repositories If you want to use a particular, fixed version of the template, be sure to pin to a ref. The refs are either branches (refs/heads/<name>) or tags (refs/tags/<name>). If you want to pin a specific commit, first create a tag pointing to that commit, then pin to that tag. You can also pin to a specific commit in Git with the SHA value for a repository resource. The SHA value is a 40-character checksum hash that uniquely identifies the commit.
upvoted 2 times
...
vsvaid
1 year, 7 months ago
Selected Answer: B
Branch can have multiple commits of template so using branch ref is no gaurantee. SHA based reference will always point to same coomit
upvoted 2 times
...
hardinxcore
1 year, 7 months ago
Selected Answer: B
Choosing d (branch) here doesn't suffice the requirement of a fixed version.
upvoted 2 times
...
Firdous586
1 year, 8 months ago
i would say D is the correct answer as per my MS Document Initially i was thinking with SHA Based only but after doing some research with other websites i did not found any evidence of SHA based therefore i would go to Branch Option only
upvoted 1 times
...
flafernan
1 year, 10 months ago
Selected Answer: B
The most widely accepted and recommended approach to ensuring that you are using a fixed version of the pipeline model is to use SHA hashing (SHA-based hashes), as it provides an accurate and reliable way to identify a specific version of code in your repository , regardless of the branch in which it is located. Therefore, while "the branch" may be a valid answer depending on the context, "SHA-based hashes" is generally a more accurate and recommended choice for referencing specific versions of code in a GitHub repository.
upvoted 3 times
Firdous586
1 year, 8 months ago
i don't think so its correct answer
upvoted 1 times
...
...
renzoku
2 years ago
Selected Answer: D
Ensure that you use a fixed version of the template. This could be done in 2 ways. template: repo: https://github.com/myorg/mytemplate ref: refs/tags/v2 #specify the fixed version of the template template: repo: https://github.com/myorg/mytemplate ref: sha:<SHA-based hash> #SHA value to the commit used to the fixed version of the template But the question is "use a fixed version" then the answer should be D, if the question would be use the version to sphttps://www.examtopics.com/exams/microsoft/az-400/view/20/#ecific commit I think should be B.
upvoted 2 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 ...