Repository navigation
Conversation
The source-index stage1 tool install step currently runs
'dotnet tool install ... --source <dnceng feed>'. NuGet's --source
flag only adds a feed; the machine/user-level NuGet configuration is
still inherited, so dotnet can probe api.nuget.org. 1ES Network
Isolation flags this as an outbound connection warning during Aspire's
CI runs (definitionId 1602).
Add a sourceIndexUseIsolatedNuGetConfig parameter, defaulting to false,
so existing source-index consumers keep the current restore behavior.
When the parameter is set to true, the download step builds an isolated
nuget.config under $(Agent.TempDirectory)/.source-index:
1. Create the .source-index and tools directories.
2. Run 'dotnet new nugetconfig --force --output <sourceIndexRoot>'.
The emitted template contains <clear/> in <packageSources>,
so machine/user sources are not inherited.
3. Remove the generated NuGet.org package source using
'dotnet nuget remove source ... --configfile <temp nuget.config>'.
4. Add only the approved 'source-index' feed via
'dotnet nuget add source ... --configfile <temp nuget.config>'.
5. 'dotnet tool install --configfile <temp nuget.config>' for
both BinLogToSln and UploadIndexStage1.
The step still runs from $(Agent.TempDirectory) so the repo's
global.json is not used. Native dotnet calls follow the existing
Arcade YAML pattern of checking $LASTEXITCODE and failing the step
with Write-Error/exit 1.
Co-authored-by: Copilot <[email protected]>
davidfowl
force-pushed
the
davidfowl/source-index-isolate-nuget-config
branch
from
May 15, 2026 04:09
c3d23b8 to
f23d432
Compare
Open
3 tasks
Member
|
@davidfowl this is not the right fix. The behavior you/Copilot talk about is the case for I assume it got confused because you use arcade 10.0 in aspire which was missing this fix, I opened the backport in #16850 |
Member
Author
|
Yea I assumed that. As long as it gets fixed I'm good closing this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1ES Network Isolation reported
dotnet.exeprobingapi.nuget.orgduring the source-index stage1 tool install step. The existingdotnet tool install --source <dnceng feed>commands add the approved feed, but still allow NuGet to inherit machine/user package sources.Summary
This adds an opt-in source-index parameter,
sourceIndexUseIsolatedNuGetConfig, defaulting tofalseso existing consumers keep the current restore behavior.When the parameter is set to
true, the source-index stage1 publish template builds an isolated temporarynuget.configunder$(Agent.TempDirectory)/.source-indexbefore installing source-index tools. The opt-in path:dotnet new nugetconfig --forceusing the stage1 SDK installed under$(Agent.TempDirectory)/dotnet.source-indexfeed fromsourceIndexPackageSource.BinLogToSlnandUploadIndexStage1with--configfile <temp nuget.config>and the existing temp tool path.The step still runs from
$(Agent.TempDirectory)so it avoids the repoglobal.json, and nativedotnetcalls follow the existing Arcade YAML pattern of checking$LASTEXITCODEand failing withWrite-Error/exit 1.Usage
Consumers can opt in through source-index parameters, for example:
The lower-level source-index job/step templates also accept
sourceIndexUseIsolatedNuGetConfig: truedirectly.Validation
source-indexsource addition flow locally. The final config contained only<clear />plus the dncengsource-indexfeed.