exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 12 question 2 discussion

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

DRAG DROP -
You need to implement the code flow strategy for Project2 in Azure DevOps.
Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Step 1: Create a repository -
A Git repository, or repo, is a folder that you've told Git to help you track file changes in. You can have any number of repos on your computer, each stored in their own folder.

Step 2: Create a fork -
Step 3: Add a build policy for the fork
Build policies help teams protect their important branches of development. Policies enforce your team's code quality and change management standards.
Scenario:
Implement a code flow strategy for Project2 that will:
✑ Enable Team2 to submit pull requests for Project2.
✑ Enable Team2 to work independently on changes to a copy of Project2.
✑ Ensure that any intermediary changes performed by Team2 on a copy of Project2 will be subject to the same restrictions as the ones defined in the build policy of Project2.

Reference:
https://docs.microsoft.com/en-us/azure/devops/repos/git/manage-your-branches

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
saschgo
Highly Voted 3 years, 5 months ago
Since a fork is a copy of a repository. Therefore no need to create a repository. - Create a fork - Add a build policy for the master branch - Add an application access policy https://docs.microsoft.com/en-us/azure/devops/repos/git/forks?view=azure-devops&tabs=visual-studio#whats-in-a-fork
upvoted 41 times
mfawew223
1 year, 1 month ago
Most comments are giving "build policy on the fork", but a fork is an entire repo. You dont apply build policies to repos. Build policies are under branch policies, set on each branch. You would apply a build policy to the master branch of the fork, so thats correct But I dont agree with application access policy. We are talking about implementing a code flow strategy. Most code flows start by creating a feature/bug/alternate branch in which to do the work. I think the third step should be "create a branch". - Create a fork - Add a build policy for the master branch - Create a branch
upvoted 3 times
mfawew223
1 year, 1 month ago
I forgot to add, no where in code flow strategies do we need application access policy. Its too early in the process to need that. I think thats trying to apply the fact that Team2 cannot access Project2, but thats why the fork is involved. They can access the Fork in leiu of Project2
upvoted 1 times
...
...
Optimist_Indian
2 years, 10 months ago
The repo for project 2 is not yet created. It is just 'planned'. So we need to create the repo first.
upvoted 6 times
...
anhtvux
1 year, 10 months ago
Why we don't just "add build policy for the fork" instead of only master branch?
upvoted 6 times
mfawew223
1 year ago
the fork is an entire repo. You dont add build policies at the repo level. Build policies are part of branch policies.
upvoted 1 times
...
...
Atos
2 years, 3 months ago
I agree with this answer. Although, I don't fully understand the 'App access policy' but it's the only option i have left.
upvoted 3 times
...
...
prabs2380
Highly Voted 2 years, 5 months ago
The answer is correct. Firstly, let me try to exclude the options which are not related - Create a branch -> Not such requirement - Add a build policy for the master branch -> No mention about Master branch. Build policy can be set at any branch depends on the project. Lets exclude this option - Add an application access policy -> No clue what it does for Azure repo Since there is no Azure repo exist for Project 2, lets include it as a first step - Create a repository - Create a fork - Add a build policy for a fork
upvoted 32 times
Dankho
5 months, 3 weeks ago
just like you don't add a build policy on App1 repo you don't add a build policy on fork repo (or copy) of app1 repo.
upvoted 1 times
Dankho
5 months, 3 weeks ago
I take it back, add a build policy for the master can infer the original repo, so fork tells us to do it for the fork main/master. It should have been worded like this, "Add a build policy for the master (or main) branch of the fork" Create a branch is also ambiguous. Do we create a branch in the original Project 2 repo or create a branch in the newly forked repo?
upvoted 1 times
...
...
arr73
7 months ago
Build policies apply to branches, no repos. I think it should be "add build policy to the master branch"
upvoted 2 times
...
anhtvux
1 year, 10 months ago
sounds right
upvoted 1 times
...
...
Dankho
Most Recent 5 months, 3 weeks ago
answer is correct, no repo exists so we need to create it first.
upvoted 1 times
Dankho
5 months, 3 weeks ago
I'm disagreeing with myself :) No need to create a repo, Project 2 exists, and a repo for it exists already. A fork is a repo copy so no repo needs to be created. After looking at everyones answer and researching, talking to Gemini and Claude lol, this is my final answer: 1) Create a fork 2) Create a branch (the context is in the new forked repo) 3) Add a build policy for the fork (not master; the question is likely designed to test your understanding of DevOps best practices in a branching and forking workflow, rather than being a purely literal interpretation of available actions within a UI)
upvoted 3 times
...
...
anantasthana2002
10 months, 1 week ago
- Create a fork - Add a build policy for the master branch - Create a branch
upvoted 4 times
...
vsvaid
1 year ago
Create a fork Add a build policy for master branch Create a branch
upvoted 4 times
...
ieboaix
1 year, 4 months ago
the given answer is correct. 1st. teams has no access to project2, so it has to be a fork. in order to do so, you need to create a repository. the last step will be a build policy on the fork which mostly like raise a PR to project 2 once everything goes well. so someone with permission of project 2 can do the merge. my 2 cents.
upvoted 1 times
...
renzoku
1 year, 5 months ago
I have doubts, In Planned changes mention that Contoso plans to create projects in Azure DevOps, then Project2 hadn't been created then you didn't have a code repository yet. But the question ask about "implement the code flow strategy for Project2 in Azure DevOps", then if we focus on the code flow strategy for Project2, I assume that the Project2 exists and now you have to implement the code flow strategy. Starting from there. 1. Create a fork, for create an independent copy of the original repository. 2. Add an application access policy, Team2 needs the necessary permissions to access on the forked repository. 3. Add a build policy for the fork, the forked repo doesn't inherit permissions or policies then you have to define it to enforce the desired behavior. Create repo in this scenary wasn't necessary. Create a branch is not a requirement, the closest requirement would be "Enable Team2 to work independently on changes to a copy of Project2", we achieve that with the fork. Add a build policy for the master branch, could limit policy on a master branch and not the repo.
upvoted 3 times
...
zellck
1 year, 6 months ago
Same as Topic 9 Question 4. https://www.examtopics.com/discussions/microsoft/view/18333-exam-az-400-topic-9-question-4-discussion
upvoted 2 times
...
zellck
1 year, 6 months ago
1. Create a fork 2. Add a build policy for master branch 3. Create a branch https://learn.microsoft.com/en-us/azure/devops/repos/git/forks?view=azure-devops&tabs=visual-studio Git repo forks are useful when people want to make experimental, risky, or confidential changes to a codebase, but those changes need to be isolated from the codebase in the original repo. A new fork is basically a clone of the original repo pushed to a new remote repo. The fork is independent of the original repo, and is a complete copy unless you specify a single branch. As an independent copy, changes you make to your fork, such as adding commits or branches, aren't shared with the original repo. If you want to merge your codebase changes into the original repo, you must create a pull request (PR) to request review and approval of those changes. The forking process doesn't transfer any permissions, policies, or build pipelines from the original repo to your fork.
upvoted 12 times
zellck
1 year, 6 months ago
https://learn.microsoft.com/en-us/azure/devops/repos/git/git-branching-guidance?view=azure-devops#keep-a-high-quality-up-to-date-main-branch The code in your main branch should pass tests, build cleanly, and always be current. Your main branch needs these qualities so that feature branches created by your team start from a known good version of code. Set up a branch policy for your main branch that: - Requires a pull request to merge code. This approach prevents direct pushes to the main branch and ensures discussion of proposed changes. - Automatically adds reviewers when a pull request is created. The added team members review the code and comment on the changes in the pull request. - Requires a successful build to complete a pull request. Code merged into the main branch should build cleanly.
upvoted 2 times
...
...
Rams_84zO6n
1 year, 9 months ago
- create a fork - Add a build policy for the fork - Add an application access policy Rationale: "Ensure that any intermediary changes performed by Team2 on a copy of Project2" - fork repo to a new repo, so need to create a repo forking process doesn't transfer any permissions, policies, or build pipelines from the original repo to your fork - so you need to add a build policy for the fork "Enable Team2 to work independently on changes to a copy of Project2" - satisfied "Enable Team2 to submit pull requests for Project2." - satisfied "Team2 members will not have permissions to project2" - Add an application access policy
upvoted 2 times
...
Def21
2 years, 3 months ago
All in all, I think the solution would be - Create a repository - Add a build policy for the master - Create a fork - Add a build policy for the fork However, we need to drop one of those, not sure which. The workflow would be: 1) make changes to your fork 2) make PR to original repo 3) original repo policies take effect. Now: Existing environment does not have repos or build policies(?) which are typically in master branch “Working independently on changes to a copy of Project2” probably means forking. “Ensure that any intermediary changes performed by Team2 on a copy of Project2 will be subject to the same restrictions” would mean we also need to add the policies to the fork repository.
upvoted 2 times
...
syu31svc
2 years, 4 months ago
"- Enable Team2 to work independently on changes to a copy of Project2. - Ensure that any intermediary changes performed by Team2 on a copy of Project2 will be subject to the same restrictions as the ones defined in the build policy of Project2." https://docs.microsoft.com/en-us/azure/devops/repos/get-started/key-concepts-repos?view=azure-devops A fork is a complete copy of a repository, including all files, commits, and (optionally) branches Given answer is correct
upvoted 6 times
...
rdemontis
2 years, 8 months ago
The answer is correct. Here first you need a Repos. You don't have one yet. Second you have to create a Fork --> "Enable Team2 to work independently on changes to a copy of Project2" Third you need a build policy for the fork
upvoted 8 times
...
Zdujgfr567783ff
2 years, 9 months ago
in case of Implement a code flow strategy for Project2 that will: - Enable Team2 to submit pull requests for Project2. - Enable Team2 to work independently on changes to a copy of Project2. - Ensure that any intermediary changes performed by Team2 on a copy of Project2 will be subject to the same restrictions as the ones defined in the build policy of Project2. may be a fork and then policy and policy (to both branches?)
upvoted 1 times
...
lugospod
2 years, 10 months ago
Got this January 2022.
upvoted 3 times
...
Sara_Mo
2 years, 11 months ago
the correct answer is - Create a repository - Create a fork - Add a build policy
upvoted 3 times
...
Sara_Mo
2 years, 11 months ago
- Create a repo - Create a fork - Add a build policy for the fork
upvoted 3 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 ...