Usage
buildcharts generate automatically injects the necessary secrets and modifications so that dotnet restore and NuGet push operations can authenticate against Azure Artifacts feeds.
What it does
- Runs
dotnet nuget list source --format short - Keeps sources whose host ends with
pkgs.dev.azure.comorpkgs.visualstudio.com - Prefers existing environment credentials when available
- Otherwise installs the Microsoft Artifacts Credential Provider under
.buildcharts/plugins/NuGetAuthenticate@v1 - Writes secret files under
.buildcharts/secrets - Writes
ARTIFACTS_CREDENTIALPROVIDER_EXTERNAL_FEED_ENDPOINTS, a JSON payload describing the endpoint(s) and associated credentials - Patches the generated
docker-bake.hclso these secrets are mounted into the Docker build
Environment variables
ARTIFACTS_CREDENTIALPROVIDER_EXTERNAL_FEED_ENDPOINTSARTIFACTS_CREDENTIALPROVIDER_ACCESSTOKENAZURE_ARTIFACTS_ENV_ACCESS_TOKENSYSTEM_ACCESSTOKENVSS_NUGET_ACCESSTOKENVSS_NUGET_EXTERNAL_FEED_ENDPOINTS
Notes
- The plugin only acts on Azure DevOps-hosted NuGet feeds.
- If no matching NuGet sources are found, the plugin exits without patching the generated HCL.