Text of code.visualstudio.com › api › working-with-extensions › publishing-extension as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Publishing Extensions | Visual Studio Code Extension API

AI agents: See llms.txt for documentation discovery and navigation. Documentation articles are also available as Markdown by appending .md to the article URL. Join VS Code at Microsoft Ignite or catch the sessions online. A year of VS Code, wrapped. Explore the highlights. Publishing Extensions View as Markdown Ask in VS Code Ask in VS Code Insiders Once you have made a high-quality extension, you can publish it to the VS Code Extension Marketplace so others can find, download, and use your extension.

Alternatively, you can package an extension into the installable VSIX format and share it with other users. This topic covers: Using vsce , the CLI tool for managing VS Code extensions Packaging , publishing and unpublishing extensions Registering a publisher necessary for publishing extensions vsce vsce , short for "Visual Studio Code Extensions", is a command-line tool for packaging, publishing and managing VS Code extensions.

Installation Make sure you have Node.js installed. Then run: npm install -g @vscode/vsce Usage You can use vsce to easily package and publish your extensions: $ cd myExtension $ vsce package # myExtension.vsix generated $ vsce publish # <publisher id>.myExtension published to VS Code Marketplace vsce can also search, retrieve metadata, and unpublish extensions. For a reference on all the available vsce commands, run vsce --help .

Publishing extensions Note Due to security concerns, vsce will not publish extensions that contain user-provided SVG images. The publishing tool checks the following constraints: The icon provided in package.json may not be an SVG. The badges provided in the package.json may not be SVGs unless they are from trusted badge providers . Image URLs in README.md and CHANGELOG.md need to resolve to https URLs. Images in README.md and CHANGELOG.md may not be SVGs unless they are from trusted badge providers .

Visual Studio Code uses Azure DevOps for its Marketplace services. This means that authentication, hosting, and management of extensions are provided through Azure DevOps. Important On December 1, 2026, global Personal Access Tokens (PATs) in Azure DevOps are retired. To keep publishing extensions, use secure automated publishing with federated identity instead of PATs. For more information, see Retirement of global Personal Access Tokens in Azure DevOps .

Secure automated publishing to Visual Studio Marketplace We recommend that extension publishing use federated identity to publish extensions without storing long-lived secrets such as Personal Access Tokens (PATs). CI/CD provider Secure publishing method GitHub Actions Publish with GitHub Actions and Trusted Publishing . Azure Pipelines Publish from Azure Pipelines with Microsoft Entra ID. Other CI/CD providers Marketplace Trusted Publishing isn't supported.

Marketplace Trusted Publishing doesn't currently support other OIDC providers. Support for additional providers might be added in the future. Both options remove stored publishing credentials and simplify credential management. For more information, see Reduce PAT usage . Publish with GitHub Actions and Trusted Publishing Trusted Publishing uses OpenID Connect (OIDC) to publish from GitHub Actions without storing a PAT as a repository secret.

First, create a Trusted Publishing policy for the workflow: Sign in to the Visual Studio Marketplace publisher management page . Open the publisher that owns your extension. Select Trusted Publishing . Expand Create , and enter the policy details: Policy name : A descriptive name, such as Release workflow . Repository owner : The exact GitHub organization or user login that owns the repository, such as contoso . Repository : The repository name without the owner, such as sample-extension .

Workflow : The workflow filename under .github/workflows , such as publish.yml . Environment : If the workflow uses a GitHub environment, enter its exact name, such as production . Otherwise, leave this field empty. Select Create . Note For a private repository, run the configured workflow within 48 hours after creating the policy. The first successful token exchange permanently activates the policy. Next, grant the publishing job permission to request an OIDC token and publish with vsce : jobs : publish : runs-on : ubuntu-latest permissions : contents : read id-token : write steps : - uses : actions/checkout@v4 - uses : actions/setup-node@v4 with : node-version : 22 - run : npm ci - run : npx @vscode/vsce publish --oidc The Marketplace credential expires after 15 minutes.

Each GitHub OIDC token can be exchanged only once. For more information, see Visual Studio Marketplace Trusted Publishing and Trusted Publishing in the vscode-vsce repository . Publish from Azure Pipelines with Microsoft Entra ID Create a Service Connection (Azure DevOps) Navigate to Project Settings → Service Connections Create a new Azure Resource Manager connection Select Workload Identity Federation (manual) Save the connection in draft mode to collect required values later Create a Managed Identity (Azure) Create a user-assigned managed identity in Azure Assign the Reader role Record the following values: Client ID , Tenant ID , Subscription details Configure Federated Credentials Establish link between Azure DevOps and Azure: Add a federated credential to the managed identity Exchange required values between systems: From Azure DevOps → Azure: issuer and subject From Azure → Azure DevOps: client ID, tenant ID, subscription In Azure DevOps, select Verify and save Grant Pipeline Access Open the service connection Grant access to the pipelines responsible for publishing Retrieve Managed Identity Resource ID (one-time) Run an Azure CLI task to retrieve the identity information: steps : - task : AzureCLI@2 displayName : 'Get identity details' inputs : azureSubscription : <ServiceConnectionName> scriptType : pscore scriptLocation : inlineScript inlineScript : | az rest -u https://app.vssps.visualstudio.com/_apis/profile/profiles/me --resource 499b84ac-1321-427f-aa17-267ca6975798 From the output JSON, capture the managed identity resource ID (the id field).

Authorize the Identity in Visual Studio Marketplace Add the managed identity (using its resource ID) as a member of your publisher. Assign the Contributor role Configure the CI/CD Pipeline Set up your Azure Pipelines CI/CD workflow Replace PAT-based authentication with the identity-based approach Publish Using Managed Identity In your pipeline, generate a Microsoft Entra ID (AAD) access token via Azure CLI. Use the token with your publishing commands (for example: vsce publish --azure-credential ).

Sample YAML tasks. Replace with the extension directory path. # Install VS Code Extension Manager (vsce >= v2.26.1 needed) and dependencies - script : | cd <ExtensionDirectory> npm install -g @vscode/vsce npm install displayName : "Install vsce and dependencies" # Publish - task : AzureCLI@2 displayName : 'Publish using managed identity' inputs : azureSubscription : <ServiceConnectionName> scriptType : pscore scriptLocation : inlineScript inlineScript : | cd <ExtensionDirectory> vsce publish --azure-credential Create a publisher A publisher is an identity that can publish extensions to the Visual Studio Code Marketplace.

Every extension needs to include a publisher identifier in its package.json file . To create a publisher: Go to the Visual Studio Marketplace publisher management page . Log in with the same Microsoft account you used to create the Personal Access Token in the previous section. Click Create publisher in the pane on the left. In the new page, specify the mandatory parameters for a new publisher - identifier and name ( ID and Name fields respectively): ID : the unique identifier for your publisher in Marketplace that will be used in your extension URLs.

ID cannot be changed once created. Name : the unique name of your publisher that will be displayed in Marketplace with your extensions. This can be your company or brand name. Below is an e

The rest of this page is on the live site.