exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 4 question 42 discussion

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

DRAG DROP -
You are implementing a package management solution for a Node.js application by using Azure Artifacts.
You need to configure the development environment to connect to the package repository. The solution must minimize the likelihood that credentials will be leaked.
Which file should you use to configure each connection? To answer, drag the appropriate files to the correct connections. Each file may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
All Azure Artifacts feeds require authentication, so you'll need to store credentials for the feed before you can install or publish packages. npm uses .npmrc configuration files to store feed URLs and credentials. Azure DevOps Services recommends using two .npmrc files.
Feed registry information: The .npmrc file in the project
One .npmrc should live at the root of your git repo adjacent to your project's package.json. It should contain a "registry" line for your feed and it should not contain credentials since it will be checked into git.
Credentials: The .npmrc file in the user's home folder
On your development machine, you will also have a .npmrc in $home for Linux or Mac systems or $env.HOME for win systems. This .npmrc should contain credentials for all of the registries that you need to connect to. The NPM client will look at your project's .npmrc, discover the registry, and fetch matching credentials from $home/.npmrc or $env.HOME/.npmrc.
Reference:
https://docs.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows

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
enowman
Highly Voted 3 years, 5 months ago
The answer on examtopics is correct. https://docs.microsoft.com/en-us/azure/devops/artifacts/get-started-npm?view=azure-devops&tabs=windows#set-up-authentication-on-your-development-machine
upvoted 32 times
PM2
3 years, 5 months ago
Agree .npmrc should contain credentials for all of the registries that you need to connect to. The NPM client will look at your project's .npmrc, discover the registry, and fetch matching credentials from $home/.npmrc or $env.HOME/.npmrc.
upvoted 9 times
...
...
27close
Highly Voted 3 years, 3 months ago
The NPM client will look at your project's .npmrc, discover the registry, and fetch matching credentials from $home/.npmrc or $env.HOME/.npmrc. so credential -home folder
upvoted 7 times
...
zellck
Most Recent 8 months ago
1. .npmrc file in the project 2. .npmrc file in user's home folder https://learn.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc Azure Artifacts enables you to publish various package types to your feeds and install packages from both feeds and public registries like npmjs.com. Before we can authenticate with Azure Artifacts, we need to configure our .npmrc file, which stores the feed URLs and credentials that Npm uses. This file can be used to customize the behavior of the Npm client, such as setting up proxies, specifying default package locations, or configuring private package feeds. The .npmrc file is located in the user's home directory and can also be created at the project level to override the default settings. By editing the .npmrc file, users can customize their Npm experience and make it more tailored to their needs.
upvoted 2 times
...
meoukg
1 year, 3 months ago
I saw this question in my exam yesterday
upvoted 4 times
...
syu31svc
1 year, 5 months ago
Given answer and link are correct
upvoted 2 times
...
tjeerd
1 year, 6 months ago
On exam 20220727. Given answer is correct.
upvoted 3 times
...
Govcomm
1 year, 6 months ago
1. Project 2. User home directory
upvoted 1 times
...
Cheehp
1 year, 9 months ago
Selected during exam. The.npmrc file in the project The .npmrc file in the user's home folder
upvoted 2 times
...
rdemontis
1 year, 10 months ago
correct answer
upvoted 1 times
...
dr_maq
3 years, 6 months ago
Field registry information will be saved in project.json file The first answer is project.json
upvoted 2 times
Beer_Enjoyer
3 years, 5 months ago
https://docs.microsoft.com/en-us/azure/devops/artifacts/get-started-npm?view=azure-devops&tabs=windows#set-up-authentication-on-your-development-machine So .npmrc is right
upvoted 6 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