Share via

I can't get a PAT to publish extension on vscode

Michele Nuzzi 0 Reputation points
2026-03-15T23:27:16.2766667+00:00

The azure application keeps kicking me out, spoiler allert, because I don't have a PAT that I'm trying to get

Azure DevOps

3 answers

Sort by: Most helpful
  1. Mohd Adeeb 0 Reputation points
    2026-04-01T04:53:28.3933333+00:00

    If you’re unable to get a PAT (Personal Access Token) for publishing a VS Code extension, make sure you’re creating it from the correct platform (usually Azure DevOps) and selecting the right permissions like “Marketplace > Manage”.

    Also check if your token is expired or not copied properlythis is a common issue. If it still doesn’t work, try generating a new token and re-login using the vsce login command.

    0 comments No comments

  2. Siddhesh Desai 6,080 Reputation points Microsoft External Staff Moderator
    2026-03-27T06:55:30.7966667+00:00

    Hi @Michele Nuzzi

    Thank you for reaching out to Microsoft Q&A.

    When attempting to publish a VS Code extension, the authentication flow expects a Personal Access Token (PAT) to already exist for the Visual Studio Marketplace publisher APIs. However, if no PAT is present, the system redirects the user through Azure sign-in repeatedly. This creates a circular authentication loop where Azure DevOps attempts to validate a PAT that has not yet been created, and the user is continuously signed out or redirected before reaching the PAT creation page. This is a known issue where authentication alternates between Azure AD sign-in and PAT validation, preventing PAT generation through VS Code or the vsce CLI directly.

    Refer below points to resolve this issue or this is the workaround:

    • Create the PAT directly from the Visual Studio Marketplace Publisher portal Sign out from all Microsoft/Azure sessions, open a private or incognito browser window, and navigate to the Visual Studio Marketplace publisher management page. From your publisher profile, go to Security → Personal Access Tokens and create a new PAT with Marketplace → Manage scope. This bypasses the broken redirect flow and allows the token to be generated successfully.
    • Use the generated PAT with VS Code or vsce Once the PAT is created, use it to authenticate with the VS Code publishing tools. For example:
        vsce login <publisher-name>
      
      When prompted, paste the PAT you created. Alternatively, you can publish directly using:
        vsce publish -p <PAT>
      
    • Avoid mixing account contexts Ensure you are using the same Microsoft account consistently for Azure DevOps, the Visual Studio Marketplace publisher, and VS Code publishing. Mixing personal Microsoft accounts and work/Entra ID accounts can re-trigger the sign-in loop and should be avoided.
    0 comments No comments

  3. Vinodh247 42,051 Reputation points MVP Volunteer Moderator
    2026-03-16T06:10:35.2933333+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    This usually happens because authentication is looping between Azure sign-in and PAT validation in the Visual Studio Marketplace publisher flow. The system expects an existing Personal Access Token (PAT) for the publisher API, but the AAD login redirects before the PAT creation page loads, which creates a circular signin loop.

    To resolve it, generate the PAT directly from the publisher management page instead of the extension publishing CLI flow. Sign in to Visual Studio Marketplace, open your publisher profile -> Security -> PAT, and create a token with marketplace (manage) scope. If the portal keeps redirecting to azure sign-in, sign out from all microsoft sessions, open a private browser window, then access the publisher page again and create the PAT. Once generated, use that token with the VS Code publishing command (for example via vsce).

     

    Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the reply was helpful. This will be benefitting other community members who face the same issue.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.