exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 5 question 7 discussion

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

DRAG DROP -
You are developing a full Microsoft .NET Framework solution that includes unit tests.
You need to configure SonarQube to perform a code quality validation of the C# code as part of the build pipelines.
Which four tasks should you perform in sequence? To answer, move the appropriate tasks from the list of tasks to the answer area and arrange them in the correct order.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Step 1: Prepare Analysis Configuration
Prepare Analysis Configuration task, to configure all the required settings before executing the build.
This task is mandatory.
In case of .NET solutions or Java projects, it helps to integrate seamlessly with MSBuild, Maven and Gradle tasks.

Step 2: Visual Studio Build -
Reorder the tasks to respect the following order:
Prepare Analysis Configuration task before any MSBuild or Visual Studio Build task.

Step 3: Visual Studio Test -
Reorder the tasks to respect the following order:
Run Code Analysis task after the Visual Studio Test task.

Step 4: Run Code Analysis -
Run Code Analysis task, to actually execute the analysis of the source code.
This task is not required for Maven or Gradle projects, because scanner will be run as part of the Maven/Gradle build.
Note:

Reference:
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS

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
vglearn
Highly Voted 3 years, 8 months ago
The right set of steps in the build pipeline is 1. Prepare Analysis Configuration – First you prepare the analysis configuration for SonarCloud 2. Visual Studio Build – Next you need to build your .Net project 3. Visual Studio Test – Next run the unit tests 4. Run Code Analysis – Then you run the code analysis using the SonarCloud tools
upvoted 61 times
ukkuru
3 years, 3 months ago
Why is code analysis run after the build is prepared. Should it be done before that?
upvoted 3 times
Dileep75
2 years, 3 months ago
you are correct, as per the link sonar task happens after restoring the solution.. so it should come before build
upvoted 2 times
...
agustinleone
3 years, 2 months ago
run code analysis is after the build because you need the files that the build generates
upvoted 6 times
...
...
Ashutosh_9608
3 years ago
Correct!! https://azuredevopslabs.com/labs/vstsextend/sonarcloud/
upvoted 3 times
rdemontis
2 years, 7 months ago
Thanks for sharing the document
upvoted 1 times
...
...
...
zalyoung
Highly Voted 4 years, 4 months ago
The answer is correct: Reorder the tasks to respect the following order: 1.Prepare Analysis Configuration task before any MSBuild or Visual Studio Build tasks. 2.Run Code Analysis task after the Visual Studio Test task. 3.Publish Quality Gate Result task after the Run Code Analysis task https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-azure-devops/
upvoted 21 times
...
ozbonny
Most Recent 8 months ago
correct ansewer according with the microsoft learning path https://microsoftlearning.github.io/AZ400-DesigningandImplementingMicrosoftDevOpsSolutions/Instructions/Labs/AZ400_M07_L14_Managing_technical_debt_with_SonarQube_and_Azure_DevOps.html
upvoted 2 times
...
vsvaid
10 months, 1 week ago
Agree with answer
upvoted 1 times
...
zellck
1 year, 4 months ago
1. Prepare Analysis Configuration 2. VS Build 3. VS Test 4. Run Code Analysis https://docs.sonarqube.org/latest/devops-platform-integration/azure-devops-integration/ - In Azure DevOps, create or edit a Build Pipeline, and add a new Prepare Analysis Configuration task before your build task - Add a new Run Code Analysis task after your build task
upvoted 8 times
...
syu31svc
2 years, 1 month ago
Order of answer is logically correct so I would go with it
upvoted 3 times
...
Govcomm
2 years, 3 months ago
Prepare analysis configuration Visual Studio Build Visual Studio Test Run code Analysis
upvoted 5 times
...
UnknowMan
2 years, 5 months ago
Prepare -> Build -> Test -> Analysis
upvoted 6 times
...
goatlord
3 years, 2 months ago
Config --> build --> test --> analysis
upvoted 6 times
...
Coder1
4 years, 1 month ago
Given answer is correct, I have done the same configuration in my project
upvoted 2 times
...
rrongcheng
4 years, 3 months ago
In that doc: 6. Click the Visual Studio Test task and check the Code Coverage Enabled checkbox to process the code coverage and have it imported into SonarQube. (Optional but recommended) Once all this is done, you can trigger a build
upvoted 1 times
...
ens1z
4 years, 4 months ago
I agree with the examtopics. 1. prepare 2. build 3. Test 4. Run code Section "Analyzing a .NET solution" from: https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-azure-devops/ Publish build artifacts doesn't necessary because the goal is to TEST app instead of deploy app
upvoted 7 times
xRiot007
1 year, 3 months ago
Artifacts are not needed. What happens behind the scenes is that a configured Sonar scanner is started. Then when building projects, it will do analysis and store any findings in some analysis files. After when testing is done it will look to pick up the test coverage files. Then it will run a task that takes all these documents and upload them to sonar cloud so you can visualize the results there. Publish is not needed. Artifacts are not needed. This is static code analysis.
upvoted 1 times
xRiot007
1 year, 3 months ago
Correction : seems that to have results you need a publish task. But that would be the 5th.
upvoted 1 times
...
...
...
AK89
4 years, 4 months ago
1. Analysis 2. Build 3.Test 4.Run 5. Publish
upvoted 4 times
...
ghola
4 years, 4 months ago
Analyzing a .NET solution In your build definition, add: At least Prepare Analysis Configuration task and Run Code Analysis task Optionally Publish Quality Gate Result task Reorder the tasks to respect the following order: Prepare Analysis Configuration task before any MSBuild or Visual Studio Build tasks. Run Code Analysis task after the Visual Studio Test task. Publish Quality Gate Result task after the Run Code Analysis task Click on the Prepare Analysis Configuration build step to configure it: You must specify the service connection (i.e. SonarQube) to use. You can: select an existing endpoint from the drop down list add a new endpoint manage existing endpoints Keep Integrate with MSBuild checked and specify at least the project key Project Key - the unique project key in SonarQube Project Name - the name of the project in SonarQube Project Version - the version of the project in SonarQube Click the Visual Studio Test task and check the Code Coverage Enabled checkbox to process the code coverage and have it imported into SonarQube. (Optional but recommended) Once all this is done, you can trigger a build
upvoted 1 times
xRiot007
1 year, 3 months ago
There is no re-ordering needed, the order is correct. Check : https://azuredevopslabs.com/labs/vstsextend/sonarcloud/
upvoted 1 times
...
...
Root_Access
4 years, 4 months ago
Answer is correct, follow the link provided on the answer section, make sure you check .net section
upvoted 1 times
...
Fred64
4 years, 5 months ago
prepare run code analysis publish quality gate build
upvoted 2 times
...
cavemanc82
4 years, 6 months ago
From that link Tos0, under "Analyzing a .NET solution" (assuming that the VSbuild task comes in at B after "Prepare": Reorder the tasks to respect the following order: Prepare Analysis Configuration task before any MSBuild or Visual Studio Build tasks. Run Code Analysis task after the Visual Studio Test task. Publish Quality Gate Result task after the Run Code Analysis task
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago