Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 4 question 27 discussion

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

You use WhiteSource Bolt to scan a Node.js application.
The WhiteSource Bolt scan identifies numerous libraries that have invalid licenses. The libraries are used only during development and are not part of a production deployment.
You need to ensure that WhiteSource Bolt only scans production dependencies.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.

  • A. Run npm install and specify the --production flag.
  • B. Modify the WhiteSource Bolt policy and set the action for the licenses used by the development tools to Reassign.
  • C. Modify the devDependencies section of the project's Package.json file.
  • D. Configure WhiteSource Bolt to scan the node_modules directory only.
Show Suggested Answer Hide Answer
Suggested Answer: AD 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
rdemontis
Highly Voted 2 years, 7 months ago
Selected Answer: AD
Correct answers are A & D. 1. When you use --production flag in npm install devDependencies are not installed (so C is wrong). 2. npm install command installs the dependencies to the local node_modules folder. https://docs.npmjs.com/cli/v8/commands/npm-install 3. WhiteSource scan the entire project folder by default. You have to configure it to scan only the node_modules since the production dependencies are there. https://whitesource.atlassian.net/wiki/spaces/WD/pages/33751265/Previous+Version+of+WhiteSource+Bolt+for+Azure+Pipeline#Build-Configuration-for-Azure-DevOps-Server "If there is a policy match on a Reassign action, the request will be automatically reassigned to a designated user or group in the system which is not the default approver." https://whitesource.atlassian.net/wiki/spaces/WD/pages/34013519/Managing+Automated+Policies#Applying-Actions-to-a-Library But is this action required in the question? Of course no. So even B is wrong
upvoted 23 times
cluqueg
1 year, 6 months ago
This is a very tricky approach and it's not the best solution at all.
upvoted 2 times
...
...
27close
Highly Voted 3 years, 12 months ago
the answer is correct - devDependent and productionflag
upvoted 19 times
ravikrg
2 years ago
I think, devDependencies and productionflag are interlinked when we add devDependencies and during installation add the productionflag the devDependencies will not be installed. And coming to option D, if we are using productionflag why do we need to configure the whitesource to look at node_modules folder, isn't it obvious that node_modules is where the packages are installed? why do we need to exclusively set to look at node_modules? My answer would be CA in sequence. Please correct me if I am wrong
upvoted 1 times
...
nakedsun
1 year, 8 months ago
Answer is correct, not sure what everyone else is smoking, guess there are not many Node devs here. How will Whitesource/Mend know which deps are for develpoment unless we modify packakge.json and assign the dev dependancies, is it just going to guess? Then we need to make sure the npm install/build process uses --production so it doesn't pull the development deps. Then the scan is run (assumed to be during a pipline build) on only production deps in node_modules.
upvoted 6 times
...
...
Mattt
Most Recent 5 months, 2 weeks ago
Selected Answer: AC
First C : We should first move the dev packages to the devDependencies Then A : npm install --production
upvoted 4 times
...
ozbonny
8 months, 1 week ago
Selected Answer: AC
I think I'll go by A and C since the question says 'The libraries are used only during development and are not part of a production deployment.' it means that you need to add the dev dependencies in your Package.json file.
upvoted 6 times
...
DGladiator
1 year, 5 months ago
A. Run npm install and specify the --production flag. This will make npm only install the dependencies listed in the "dependencies" section of your package.json and skip those listed in the "devDependencies" section, which are assumed to be only relevant for development purposes. Therefore, only production dependencies will be present in the node_modules directory for WhiteSource Bolt to scan. D. Configure WhiteSource Bolt to scan the node_modules directory only. By focusing the scan to the node_modules directory, you ensure that WhiteSource Bolt only considers packages that have been installed and are needed for production. It would not take into account those packages which are purely for development purposes and thus not present in this directory.
upvoted 3 times
...
cluqueg
1 year, 6 months ago
Selected Answer: AC
AC is the correct and enforces an smart definition of run-time and development deps.
upvoted 4 times
...
mmdex
1 year, 9 months ago
Selected Answer: AC
I'd say the answer AC is correct. You need to modify devDependencies in package.json (C) so that npm knows which dependencies are for development use only, and run install with --production flag (A) to not install them. I do not see how D would help me. Both production and development dependencies are installed in the same "node_modules" folder. Restricting WhiteSource to scan only this folder would not exclude development dependencies.
upvoted 6 times
AzureJobsTillRetire
1 year, 9 months ago
This answer makes the most sense to me so far. I think we need both production and development and not production only.
upvoted 1 times
...
...
meoukg
1 year, 12 months ago
A & D were my chosen answers yesterday when I sat on this exam and I passed
upvoted 6 times
...
syu31svc
2 years, 2 months ago
Selected Answer: AD
npm install is what you need to do so A is correct https://stackoverflow.com/questions/72784118/unable-resolve-npm-dependencies-while-whitesource-scan-in-jenkins "doing whitesource scan for node_modules directory and when scanning ,in resolving dependency" Taking D as the other answer
upvoted 3 times
...
tjeerd
2 years, 3 months ago
Selected Answer: AD
On exam 20220727.
upvoted 6 times
...
UnknowMan
2 years, 5 months ago
AB C is strange... we dont want to update our dev dependencies to valid our prod dependencies..
upvoted 1 times
...
Cheehp
2 years, 6 months ago
Selected during exam. A. Run npm install and specify the --production flag. B. Modify the WhiteSource Bolt policy and set the action for the licenses used by the development tools to Reassign.
upvoted 2 times
SoftwareEngineeringMaster
2 years, 4 months ago
Ok, what your score or percentage of area you need improve it.
upvoted 1 times
...
...
AlexLiourtas
2 years, 7 months ago
Selected Answer: AB
Tested
upvoted 1 times
debleenac85
2 years, 6 months ago
B is an independant option. We do not have to do Step A, if we do Step B. Here the question mentions part of solution. So AD will be the answer.
upvoted 2 times
...
...
jasifu3
2 years, 7 months ago
Selected Answer: AB
so I guess people are just upvoting the most upvoted answer because it's usually correct? In this case it's clearly wrong. Modifying devDependencies will modify... your development dependencies. Which is undesirable. Here we just want to change what whitesource does.
upvoted 2 times
prashantjoge
2 years, 7 months ago
Eash answer represents part of the problem. So it is correct
upvoted 1 times
prashantjoge
2 years, 7 months ago
what reassign does - Reassign the request to a designated user or group in the system which is not the default approver.
upvoted 1 times
...
...
jasifu3
2 years, 7 months ago
actually, the answer may be AD, since npm install with the production flag will ensure that only prod dependencies are in node_modules. IDK the details of how whitesource works though - if it usually looks elsewhere then node_modules too.
upvoted 4 times
...
...
pengyanb
2 years, 8 months ago
A and B are correct. https://whitesource.atlassian.net/wiki/spaces/WD/pages/34013519/Managing+Automated+Policies
upvoted 3 times
...
pengyanb
2 years, 8 months ago
C doesn't make any sense. Why do you need to modify the devDepenedency???? npm install with --production flag will only install the prod dependency, whatever is specified in the "devDependency" is not relevant.
upvoted 3 times
...
malikimran21
2 years, 10 months ago
this came in today exam Az-400 (Dec 2021)
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 ...