Step-by-step guide to create a publisher and generate a Personal Access Token (PAT) for automated publishing to the VS Code Marketplace.
- A Microsoft account (or GitHub account linked to Azure DevOps)
- Access to your GitHub repository settings
- Go to the VS Code Marketplace Publisher Management
- Sign in with your Microsoft or GitHub account
- Click Create Publisher
- Fill in:
- Name: Your publisher display name (e.g.,
My Name) - ID: Your publisher ID (e.g.,
my-publisher) — this goes inpackage.jsonpublisherfield
- Name: Your publisher display name (e.g.,
- Click Create
Important: The publisher ID in your
package.jsonmust match the publisher you create here.
- Go to Azure DevOps
- Sign in with the same account you used for the publisher
- Click your profile picture (top right) → Personal access tokens
- Click New Token
- Fill in:
- Name:
vsce-publish(or any name you prefer) - Organization: Select All accessible organizations
- Expiration: Choose a duration (max 1 year)
- Scopes: Click Custom defined → check Marketplace → Manage
- Name:
- Click Create
- Copy the token immediately — you won't be able to see it again
Note: You must select "All accessible organizations". If you select a specific organization, publishing will fail with a 401 error.
Go to your repository → Settings → Secrets and variables → Actions → New repository secret
| Secret Name | Value |
|---|---|
VSCE_PAT |
The Personal Access Token from Step 2 |
Make sure your package.json has the correct publisher:
{
"publisher": "your-publisher-id"
}Once the secret is configured, go to Actions tab → Publish Extension → Run workflow to:
- Run CI checks
- Build the
.vsixpackage - Publish to VS Code Marketplace
- Publish to Open VSX Registry
- Create a GitHub Release
- Make sure you selected All accessible organizations when creating the PAT.
- Make sure the PAT has Marketplace > Manage scope.
- Check that the PAT hasn't expired.
- The
publisherfield inpackage.jsonmust exactly match the publisher ID you created in Step 1.
- Another publisher already owns that extension name. Change the
namefield inpackage.json.
- Tokens expire based on the duration you set (max 1 year). Create a new token and update the
VSCE_PATsecret.