Exam AZ-400 All QuestionsBrowse all questions from this exam
Question 202

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?

    Correct Answer: B

    To ensure using a fixed version of the template in a GitHub repository, you should reference the specific commit that you want to use. The SHA-based hashes provide an accurate and reliable way to identify a specific version of code, as they uniquely identify the commit regardless of any branch changes. Branches can change over time with new commits, but SHA-based hashes ensure that you are always referencing the exact same commit, thus guaranteeing the consistency required for a fixed version of the template.

Discussion
WengatzOption: 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.

resonantOption: 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.

resonant

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.

zellckOption: D

D is the answer. 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.

DrSohan93Option: 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."

UrbanRellikOption: 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.

flafernanOption: 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.

Firdous586

i don't think so its correct answer

renzokuOption: 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.

5c3d677Option: 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.

freddyneenOption: 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.

vsvaidOption: B

Branch can have multiple commits of template so using branch ref is no gaurantee. SHA based reference will always point to same coomit

hardinxcoreOption: B

Choosing d (branch) here doesn't suffice the requirement of a fixed version.

Firdous586Option: D

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