exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 7 question 63 discussion

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

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You use Azure Pipelines to build and test a React.js application.
You have a pipeline that has a single job.
You discover that installing JavaScript packages from npm takes approximately five minutes each time you run the pipeline.
You need to recommend a solution to reduce the pipeline execution time.
Solution: You recommend defining a container job that uses a custom container that has the JavaScript packages preinstalled.
Does this meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
Zoli75
Highly Voted 4 years, 4 months ago
Correct, but I found a better explanation: https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops
upvoted 7 times
...
rdemontis
Highly Voted 3 years, 4 months ago
Selected Answer: A
I think the answer is A (Yes). "Containers provide isolation from the host and allow you to pin specific versions of tools and dependencies. Host jobs require less initial setup and infrastructure to maintain" https://docs.microsoft.com/en-us/azure/devops/pipelines/process/container-phases?view=azure-devops "Containers can be hosted on registries other than Docker Hub. To host an image on Azure Container Registry or another private container registry, add a service connection to the private registry. Then you can reference it in a container spec:" https://docs.microsoft.com/en-us/azure/devops/pipelines/process/container-phases?view=azure-devops#endpoints Since it's possible to build an application inside a container and the container can be generated via a custom image, I'd say that using in the build pipeline a container with an image that already has the js packages installed can be a great solution.
upvoted 6 times
Def21
2 years, 11 months ago
B is correct. This does not help. You still need to install the package when you build the container. You should use container registry to store a ready image.
upvoted 4 times
xRiot007
2 years ago
@Def21 - Why - You can have in the registry an image with those tools already installed and then you just use it.
upvoted 2 times
...
...
...
klayytech
Most Recent 1 week, 6 days ago
Selected Answer: A
Correct Answer: A. Yes 🔍 Explanation: The scenario describes slow npm package installation (taking ~5 minutes) in an Azure Pipeline building a React.js app. The goal is to reduce the pipeline execution time. ✔ Why this solution works: Container jobs in Azure Pipelines allow you to run steps inside a Docker container. If you define a custom container image that already has the required JavaScript packages (node_modules) preinstalled, the pipeline doesn't need to download them again. This removes repetitive npm install times from the job, speeding up execution significantly. It's especially effective if your package dependencies don’t change frequently. 📝 Additional Notes: While using caching (npm ci with Azure Pipeline caching tasks) is another common approach, a prebuilt container with dependencies baked in is also a valid and efficient solution. It's important to update the container image when dependencies change, which is manageable through CI triggers on package.json changes.
upvoted 1 times
...
Gooldmember
9 months, 1 week ago
Selected Answer: A
A, Yes this meets the goal, but pipeline caching is the preferred
upvoted 1 times
...
vsvaid
1 year, 7 months ago
Selected Answer: B
No for me. Use pipeline caching
upvoted 2 times
...
xRiot007
2 years ago
Answer is Yes. You can build a Docker container image with these already installed and save it in your registry. Later, you just use it dirrectly.
upvoted 2 times
...
syu31svc
3 years ago
Selected Answer: B
https://docs.microsoft.com/en-us/azure/devops/pipelines/release/caching?view=azure-devops "Pipeline caching can help reduce build time by allowing the outputs or downloaded dependencies from one run to be reused in later runs, thereby reducing or avoiding the cost to recreate or redownload the same files again. Caching is especially useful in scenarios where the same dependencies are downloaded over and over at the start of each run. This is often a time consuming process involving hundreds or thousands of network calls. Caching can be effective at improving build time provided the time to restore and save the cache is less than the time to produce the output again from scratch. Because of this, caching may not be effective in all scenarios and may actually have a negative impact on build time." Answer is No
upvoted 4 times
...
srikrishnan22
3 years, 3 months ago
Selected Answer: B
answer is B
upvoted 4 times
...
Art3
3 years, 6 months ago
It's not sure, but I think that YES, it decreases total time.
upvoted 1 times
...
Sakile
3 years, 10 months ago
From Microsoft: Pipeline caching can help reduce build time by allowing the outputs or downloaded dependencies from one run to be reused in later runs, thereby reducing or avoiding the cost to recreate or redownload the same files again. Caching is especially useful in scenarios where the same dependencies are downloaded over and over at the start of each run. This is often a time consuming process involving hundreds or thousands of network calls.
upvoted 3 times
...
Concay
4 years, 2 months ago
Answer should be correct..container image wont rebuild but skip if nothing change
upvoted 5 times
mpindado
4 years, 2 months ago
The container job will not build the image, but use the image to create a container in which the app is built. So using a container with a pre-computed image is not only valid but common parttern in any CI-CD system. Yes is correct.
upvoted 7 times
hotspot02103
7 months, 3 weeks ago
the problem is that we have to think it "the MS way" ......
upvoted 1 times
...
...
...
Tesshu
4 years, 4 months ago
Wouldn't the docker image meet the goal anyway? maybe is not the best solution but I think it does meet the goal of reducing the time since you could have a base image with the packages. Any idea?
upvoted 5 times
Sylph
4 years, 4 months ago
I also think the docker image could be a solution. It does seem more work to setup and keep up to date than plain caching though. https://docs.microsoft.com/en-us/azure/devops/pipelines/process/container-phases?view=azure-devops
upvoted 3 times
...
haxaffe
4 years, 4 months ago
Yes I will go with "Yes" on the test if this pops up. Those chain questions can have multiple correct answers as far as i know.
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 ...