title: Use NuGetCommand@2 to push packages to nuget.org
body: <p>The <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/artifacts/nuget?view=azure-devops&amp;tabs=yaml" rel="nofollow noreferrer">documentation here</a> says</p>
  <blockquote>
  <p>To publish to an external NuGet feed, you must first create a service connection to point to that feed....</p>
  </blockquote>
  <p>It then provides this YAML:</p>
  <pre><code>- task: NuGetAuthenticate@0
    inputs:
      nuGetServiceConnections: '&lt;Name of the NuGet service connection&gt;'
  - task: NuGetCommand@2
    inputs:
      command: push
      nuGetFeedType: external
      versioningScheme: byEnvVar
      versionEnvVar: &lt;VersionVariableName&gt;
  </code></pre>
  <p>This fails with</p>
  <blockquote>
  <p>&quot;Error: The service connection for 'https://api.nuget.org/v3/index.json' is not valid. ApiKey service connections are not supported in this task. Instead, use -ApiKey (NuGet) or --api-key (dotnet) when invoking the tool itself. See the task documentation for more details.&quot;</p>
  </blockquote>
  <p>I have created a service connection that points to nuget.org with my ApiKey.</p>
  <p>I do not understand this portion of the error message: &quot;Instead, use -ApiKey (NuGet) or --api-key (dotnet) when invoking the tool itself. See the task documentation for more details.&quot;</p>
  <p>I have also seen <a href="https://stackoverflow.com/questions/52920786/publish-nuget-package-using-azure-devops">this question</a> which refers to a deficiency which has since been implemented.</p>
  <p>Edit:  Turns out the deficiency mentioned above is a red herring.  The real problem is a limitation of nuget which still exists as of this writing.</p>