exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 5 question 23 discussion

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

You use Git for source control.

You enable GitHub code scanning.

You raise a pull request from a non-default branch. In the code scanning output, you receive the following error message: “Analysis not found.”

You need to ensure that the code scanning completes successfully for the pull request.

Which two actions should you perform? Each correct answer presents part of the solution.

NOTE: Each correct selection is worth one point.

  • A. Add the name of the default branch to the on: push specification in the code scanning workflow.
  • B. Add the name of the non-default branch to the on:push specification in the code scanning workflow.
  • C. Delete the pull request, and then raise the request again from the default branch.
  • D. Update the code in the pull request.
  • E. Add a new workflow for code scanning.
Show Suggested Answer Hide Answer
Suggested Answer: BD 🗳️

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, 4 months ago
Selected Answer: BD
From https://docs.github.com/en/[email protected]/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository There are other situations where there may be no analysis for the latest commit to the base branch for a pull request. These include: The pull request has been raised against a branch other than the default branch, and this branch hasn't been analyzed. The solution in this situation is to add the name of the base branch to the on:push [THIS IS ANSWER B] and on:pull_request specification in the code scanning workflow on that branch and then make a change that updates the open pull request that you want to scan [THIS IS ANSWER D].
upvoted 23 times
AzureJobsTillRetire
2 years, 4 months ago
I think this answer is more convincing.
upvoted 1 times
...
...
memoor
Highly Voted 2 years, 4 months ago
Given answer is correct...https://docs.github.com/en/[email protected]/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository
upvoted 8 times
AzureJobsTillRetire
2 years, 4 months ago
The solution in this situation is to add the name of the base branch to the on:push and on:pull_request specification in the code scanning workflow on that branch and then make a change that updates the open pull request that you want to scan.
upvoted 4 times
...
...
MrAZ105
Most Recent 7 months, 1 week ago
Selected Answer: BD
BD is the right answer
upvoted 1 times
...
Marti98
11 months, 1 week ago
Selected Answer: AD
I think people here don't really understand what is the "base" branch in the documentation they quote. However, it is explained above in the docs: "base branch (the branch into which you want to merge the pull request)" "topic branch (the branch you used to create the pull request)" In the question, Microsoft states: "You raise a pull request from a non-default branch." -> This means that the non-default branch is named in the documentation "topic branch" -> The default branch is called in the documentation the base branch. So when the documentation says: "The solution in this situation is to add the name of the base branch to the on:push and on:pull_request specification in the code scanning workflow on that branch and then make a change that updates the open pull request that you want to scan." They mean nothing else than: "add the name of the default branch to the on:push "
upvoted 1 times
...
vsvaid
1 year, 5 months ago
Selected Answer: BD
Agree with BD
upvoted 3 times
...
Firdous586
1 year, 6 months ago
The solution in this situation is to add the name of the base branch to the on:push and on:pull_request specification in the code scanning workflow on that branch and then make a change that updates the open pull request that you want to scan. https://docs.github.com/en/[email protected]/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository 100% BD is the correct answer
upvoted 2 times
...
Firdous586
1 year, 6 months ago
The solution in this situation is to add the name of the base branch to the on:push and on:pull_request specification in the code scanning workflow on that branch and then make a change that updates the open pull request that you want to scan. https://docs.github.com/en/[email protected]/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository 100% BD is the correct answer
upvoted 2 times
...
software_dev_delivery
1 year, 7 months ago
BD Given the scenario, the two actions that make the most sense are: B. Add the name of the non-default branch to the on:push specification in the code scanning workflow. D. Update the code in the pull request (only because this action might trigger the code scanning if the workflow is set up to run on pull requests).
upvoted 1 times
...
heeloco
1 year, 9 months ago
Selected Answer: AD
https://docs.github.com/en/[email protected]/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository#reasons-for-the-analysis-not-found-message with example and wording of the "default branch"
upvoted 3 times
...
ieboaix
1 year, 9 months ago
after read the https://docs.github.com/en/[email protected]/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository , i think given answer is correct. the base branch mentioned the in article is the branch you want to merge into. so A and D.
upvoted 2 times
...
renzoku
1 year, 10 months ago
Selected Answer: BD
B. Add the name of the non-default branch to the on:push specification in the code scanning workflow. name: Code Scanning on: push: branches: - feature-dev # we have to add non-default branch NON-DEFAULT branch -> pull request -> DEFAULT branch Add who is pushing the code to 'on: push: branches:' D. Update the code in the pull request. If there's an error in the code, the code scanning workflow wouldn't triggered and you'll get the error "Analysis not found"
upvoted 1 times
...
zellck
2 years ago
Selected Answer: BD
BD is the answer. https://docs.github.com/en/[email protected]/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository?learn=code_security_actions&learnProduct=code-security#reasons-for-the-analysis-not-found-message The solution in this situation is to add the name of the base branch to the on:push and on:pull_request specification in the code scanning workflow on that branch and then make a change that updates the open pull request that you want to scan.
upvoted 4 times
...
FNog
2 years, 2 months ago
Selected Answer: BD
So, the trick here seems to be making a small change (any change, really) to the already updated and pushed branch after the on:push branch re-configuration has been made, so that the on:push event will trigger once again, although, this time, with the correct branch setup hence starting the code scan.
upvoted 3 times
...
kay000001
2 years, 3 months ago
Selected Answer: BD
B & D This link will explain: https://docs.github.com/en/[email protected]/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository
upvoted 2 times
...
warchoon
2 years, 4 months ago
Selected Answer: AD
https://docs.github.com/en/[email protected]/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning#scanning-pull-requests
upvoted 1 times
...
Iaminall
2 years, 4 months ago
Selected Answer: BC
I think it's bc
upvoted 3 times
...
Emil_Topics
2 years, 4 months ago
Selected Answer: BD
Its a non default branche so that name must be added
upvoted 4 times
warchoon
2 years, 4 months ago
But the pull request push will be to the default branch.
upvoted 1 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 ...