Skip to content

Use Azure CLI for early-access feed token - #27849

Merged
Justin Chung (jshigetomi) merged 1 commit into
PowerShell:masterfrom
jshigetomi:fix-linux-azure-cli
Aug 13, 2026
Merged

Justin Chung (jshigetomi) merged 1 commit into
PowerShell:masterfrom
jshigetomi:fix-linux-azure-cli

Conversation

@jshigetomi

Copy link
Copy Markdown
Collaborator

Summary

  • replace AzurePowerShell@5 with AzureCLI@2 when acquiring the early-access Azure DevOps feed token
  • fail explicitly if Azure CLI cannot return a token
  • remove the Linux agent dependency on a preinstalled Az.Accounts module

Context

The Linux SDK validation in build 707180 failed before running the inline script because the PowerShell1ES 3 image did not have a discoverable Az.Accounts module. The equivalent Windows and macOS jobs succeeded because those images had Az.Accounts installed.

Failing log: https://dev.azure.com/mscodehub/PowerShellCore/_build/results?buildId=707180&view=logs&j=32463283-3482-5fcf-b4f1-bff946268a97&t=8121e543-1209-5880-8988-618789d8de73

Avoid the AzurePowerShell task's dependency on a preinstalled Az.Accounts module when configuring early-access NuGet credentials on Linux agents.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8784f802-9d66-4692-b64d-c0713fa213cb
@jshigetomi
Justin Chung (jshigetomi) requested a review from a team as a code owner August 13, 2026 21:22
Copilot AI lite review requested due to automatic review settings August 13, 2026 21:22
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

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

This PR updates the Azure Pipelines template responsible for setting up Azure Artifacts authentication in early-access scenarios by switching from the Azure PowerShell task to the Azure CLI task for token acquisition, removing the dependency on a preinstalled Az.Accounts module (notably impacting Linux agents).

Changes:

  • Replaces AzurePowerShell@5 with AzureCLI@2 to acquire an Azure DevOps access token via az account get-access-token.
  • Adds an explicit failure path when the Azure CLI token request fails or returns an empty token.
  • Keeps the existing secret/variable wiring for VSS_NUGET_EXTERNAL_FEED_ENDPOINTS, but now backed by an Azure CLI–acquired token.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.4.x-Migrated Backport-7.5.x-Migrated Backport-7.6.x-Done CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants