pcislo / vscode-nuget-gallery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Azure Private Nuget - It could be permitted adding a new config in settings with packageSourceCredentials

ericquadros opened this issue · comments

If anyone has a Azure Private Nuget, it could serve passing packageSourceCredentials in the new config in settings

Like this:

{
    "name": "new",
    "url": "https://pkgs.dev.azure.com/new/_packaging/new/nuget/v3/index.json",
    "packageSourceCredentials": {
        "username": "user",
        "clearTextPassword": "password"
    }
}

For example, in some project that has a azure private nuget, here is created a file "nuget.config" with a section packageSourceCredentials.

Example:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="new" value="https://pkgs.dev.azure.com/new/_packaging/new/nuget/v3/index.json" />
  </packageSources>
  <packageManagement>
    <add key="format" value="0" />
    <add key="disabled" value="False" />
  </packageManagement>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
  <packageSourceCredentials>
    <new>
      <add key="Username" value="new@new.com.br" />
      <add key="ClearTextPassword" value="euwofnfoiejfeiwohdfeiojddodwkdsodspdis" />
    </new>
  </packageSourceCredentials>
</configuration>

Hey, I can use either file to add a new source? Where do I put these files (at the appsettings.json level)?