Skip to content

chore(ci): automate VS Code Marketplace release via OIDC Trusted Publishing #1159

Backlog

Description

@taj54

Summary

Update Visual Studio Marketplace publishing in build/templates/publish.yml for the Python Debugger extension (ms-python.debugpy) to use native OIDC / Workload Identity Federation rather than acquiring an AAD token (MarketplaceAADToken) and passing it as a token via --pat (npx @vscode/vsce@latest publish --pat $aadToken ...).

Motivation

  • Currently, build/templates/publish.yml uses AzureCLI@2 (azureSubscription: ${{ parameters.azureSubscription }}) to fetch a token for resource 499b84ac-1321-427f-aa17-267ca6975798, stores it in MarketplaceAADToken, and passes --pat $aadToken to npx @vscode/vsce@latest publish across each platform in buildPlatforms along with --manifestPath and --signaturePath.
  • Azure DevOps is retiring global PATs on January 27, 2027 (after which all existing global PATs will stop working), making native OIDC Trusted Publishing (vsce publish --oidc for GitHub Actions) or Entra Workload Identity Federation without --pat token-passing the cleanest, most secure authentication path for Marketplace releases and pre-releases.

Implementation Details

  1. Marketplace & Identity Configuration (Manual Prerequisite):

    • Open the ms-python publisher settings on the Visual Studio Marketplace Publisher Management Portal.
    • If publishing via GitHub Actions: add a Trusted Publishing policy scoped to microsoft/vscode-python-debugger, the release/pre-release workflow file in .github/workflows/, and any target environment.
    • If publishing via Azure Pipelines (build/templates/publish.yml): ensure the service connection uses Microsoft Entra Workload Identity Federation and that the service principal/identity is granted publisher permissions directly on ms-python without relying on --pat token exchange.
  2. Pipeline / Workflow Updates:

    • Update build/templates/publish.yml (or the corresponding GitHub Actions release workflow) to authenticate via OIDC / Workload Identity Federation instead of passing --pat $aadToken in the PowerShell@2 publishing loop.
    • Preserve platform iteration (buildPlatforms), signed .vsix discovery, --manifestPath, --signaturePath, --no-verify, and --pre-release handling when ${{ parameters.preRelease }} is True.
    • Remove the intermediate MarketplaceAADToken secret variable / az account get-access-token --pat workaround once verified.

Acceptance Criteria

  • Trusted Publishing policy (for GitHub Actions) or Entra Workload Identity Federation access (for Azure Pipelines) is configured for the ms-python publisher and scoped to microsoft/vscode-python-debugger.
  • build/templates/publish.yml (and/or calling workflows) publishes platform-specific signed .vsix packages (--manifestPath and --signaturePath) without passing an AAD token via --pat.
  • Both pre-release (preRelease: true) and stable (preRelease: false) publishes succeed for all configured buildPlatforms without requiring global PATs.

Activity

  1. added
    triage-needed
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage-needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions