From 57554dcbde71dc54f945a5457181dce268944b4e Mon Sep 17 00:00:00 2001 From: "Gavin Barron (from Dev Box)" Date: Mon, 20 Jul 2026 09:12:53 -0700 Subject: [PATCH] Install SDK modules from the CFS central package feed Installs the Microsoft.Graph[.Beta] modules from the PowerShell_V2_Build Azure Artifacts feed instead of PSGallery (network isolation / CFS compliance). Requires a pipeline run to validate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9bd6fe40-0d69-4e3f-927b-8628c0ab6d34 --- azure-pipelines/update-template.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/azure-pipelines/update-template.yml b/azure-pipelines/update-template.yml index 0f3cb7d30b636..cd0ec7be60216 100644 --- a/azure-pipelines/update-template.yml +++ b/azure-pipelines/update-template.yml @@ -5,16 +5,23 @@ steps: targetType: 'inline' pwsh: true script: | + # Register the central CFS feed (network-isolation compliance) and install the SDK modules from it. + $token = ConvertTo-SecureString "$env:SYSTEM_ACCESSTOKEN" -AsPlainText -Force + $cred = [System.Management.Automation.PSCredential]::new("azure", $token) + $feedUrl = "https://microsoftgraph.pkgs.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_packaging/PowerShell_V2_Build/nuget/v2" + if (-not (Get-PSRepository -Name PowerShell_V2_Build -ErrorAction SilentlyContinue)) { + Register-PSRepository -Name PowerShell_V2_Build -SourceLocation $feedUrl -InstallationPolicy Trusted -Credential $cred + } try{ # Try to update the V1 module first. - Install-Module Microsoft.Graph.Beta -Repository PSGallery -Scope AllUsers -AcceptLicense -SkipPublisherCheck -Force -AllowClobber + Install-Module Microsoft.Graph.Beta -Repository PowerShell_V2_Build -Credential $cred -Scope AllUsers -AcceptLicense -SkipPublisherCheck -Force -AllowClobber }catch{ # If the module is not installed, install it. echo "Error when installing Beta" } try{ # Try to update the beta module first. - Install-Module Microsoft.Graph -Repository PSGallery -Scope AllUsers -AcceptLicense -SkipPublisherCheck -Force -AllowClobber + Install-Module Microsoft.Graph -Repository PowerShell_V2_Build -Credential $cred -Scope AllUsers -AcceptLicense -SkipPublisherCheck -Force -AllowClobber }catch{ # If the module is not installed, install it. echo "Error when installing V1" @@ -25,5 +32,7 @@ steps: { echo $r.Version } + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) - template: checkout.yml \ No newline at end of file