Skip to content

Enable CFSClean policies and use dotnet-public feed for winget CLI - #15442

Merged
Ankit Jain (radical) merged 3 commits into
microsoft:mainfrom
mmitche:enable-cfsclean-main
Mar 23, 2026
Merged

Ankit Jain (radical) merged 3 commits into
microsoft:mainfrom
mmitche:enable-cfsclean-main

Conversation

@mmitche

Copy link
Copy Markdown
Member
  • Add networkIsolationPolicy: Permissive, CFSClean, CFSClean2 to the 1ES official pipeline template parameters
  • Switch winget CLI installation from PSGallery to dotnet-public Azure Artifacts feed to comply with CFSClean network restrictions

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

- Add networkIsolationPolicy: Permissive, CFSClean, CFSClean2 to
  the 1ES official pipeline template parameters
- Switch winget CLI installation from PSGallery to dotnet-public
  Azure Artifacts feed to comply with CFSClean network restrictions

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings March 20, 2026 16:46
@github-actions

github-actions Bot commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15442

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15442"

@mmitche

Copy link
Copy Markdown
Member Author

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the official Azure Pipelines configuration to support CFSClean network isolation policies and adjusts WinGet CLI prep to install the required PowerShell WinGet client module from the dotnet-public Azure Artifacts feed instead of PSGallery, aligning with CFSClean restrictions.

Changes:

  • Adds networkIsolationPolicy settings to the 1ES official pipeline template parameters.
  • Switches Microsoft.WinGet.Client installation to use the dotnet-public feed by registering it as a PSResource repository.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
eng/pipelines/templates/prepare-winget-manifest.yml Registers dotnet-public as a PSResource repository and installs Microsoft.WinGet.Client from it before running WinGet manifest generation/validation.
eng/pipelines/azure-pipelines.yml Adds 1ES settings.networkIsolationPolicy to enable CFSClean/CFSClean2 policies alongside Permissive.

Comment thread eng/pipelines/azure-pipelines.yml Resolved
@radical
Ankit Jain (radical) enabled auto-merge (squash) March 23, 2026 19:19
@radical
Ankit Jain (radical) merged commit 7a2e44d into microsoft:main Mar 23, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

if ($null -eq $existingRepo) {
Register-PSResourceRepository -Name $repoName -Uri $repoUri -Trusted
} else {
Write-Host "PSResource repository '$repoName' is already registered. Skipping registration."

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repository registration is idempotent by name, but it doesn't verify the existing repository's Uri. If an agent already has a dotnet-public repo registered with a different URI, this step will silently keep the wrong feed and Install-PSResource may fail or pull from an unexpected source. Consider validating the URI (and updating/re-registering when it differs) rather than unconditionally skipping when the name exists.

Suggested change
Write-Host "PSResource repository '$repoName' is already registered. Skipping registration."
# Validate that the existing repository points to the expected URI.
if ($existingRepo.Uri -ne $repoUri) {
Write-Host "PSResource repository '$repoName' is registered with URI '$($existingRepo.Uri)', expected '$repoUri'. Updating repository configuration..."
Set-PSResourceRepository -Name $repoName -Uri $repoUri -Trusted
} else {
Write-Host "PSResource repository '$repoName' is already registered with the expected URI. Skipping registration."
}

Copilot uses AI. Check for mistakes.
@@ -42,9 +42,19 @@ steps:
displayName: 🟣Set version ${{ parameters.version }}

- pwsh: |

Copilot AI Mar 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pwsh step doesn't set $ErrorActionPreference = 'Stop' (unlike other steps in this template). If Register-PSResourceRepository/Install-PSResource emits non-terminating errors, the script could continue and later steps will fail in harder-to-diagnose ways. Set ErrorActionPreference to Stop for this block (or add explicit error handling) to ensure failures stop the job immediately.

Suggested change
- pwsh: |
- pwsh: |
$ErrorActionPreference = 'Stop'

Copilot uses AI. Check for mistakes.
@radical

Copy link
Copy Markdown
Member

/backport to release/13.2

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/13.2 (link to workflow run)

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

No documentation PR is required for this change.

PR #15442 modifies only internal CI/build pipeline files (eng/pipelines/azure-pipelines.yml and eng/pipelines/templates/prepare-winget-manifest.yml) to enable CFSClean network isolation policies and switch the WinGet CLI installation source. These are build infrastructure changes with no user-facing behavior, public API, configuration options, or documented features that need updating on aspire.dev.

Generated by PR Documentation Check · ● 115.7K · ◷

@github-actions github-actions Bot locked and limited conversation to collaborators Jun 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants