QuestionQ47

DevSecOps Pipeline-Code Stage

David Paymer has worked as a senior DevSecOps engineer at an IT company for the past 5 years. His organization uses Azure DevOps services to build and deliver software products securely and quickly. David's team leader has asked him to publish a NuGet package using the command line.

If you were in David's position, which command would you use to publish the NuGet package to the feed?

  • A nuget.exe push -Destination “< YOUR_FEED_NAME >” -ApiKey < ANY_STRING > < PACKAGE_PATH >
  • B nuget.exe push -Source “< YOUR_FEED_NAME >” -ApiKey < ANY_STRING > < PACKAGE_PATH >
  • C nuget.exe publish -Source “< YOUR_FEED_NAME >” -ApiKey < ANY_STRING > < PACKAGE_PATH >
  • D nuget.exe publish -Destination “< YOUR_FEED_NAME >” -ApiKey < ANY_STRING > < PACKAGE_PATH >
Explanation

The NuGet CLI tool (nuget.exe) uses the push command to publish a package to a feed, not publish — that verb does not exist in nuget.exe. The correct parameter to specify the target feed is -Source, not -Destination. When pushing to an Azure Artifacts feed, the command follows the pattern: nuget.exe push -Source "<feed_name_or_URL>" -ApiKey <any_string> <package_path>. The API key can be any non-empty string because Azure Artifacts authenticates via the NuGet credential provider rather than validating the API key value itself.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!