From 851a417f7d33223c6a22b950f5e2b0ccaddd3266 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 7 Oct 2026 22:05:13 +0000 Subject: [PATCH] Look up the VS Code publisher member ID in a way that works for an app The Check Marketplace access step names the identity to add to the publisher, but read it from profiles/me, which answers VSS011031 for a service principal: an app has no Azure DevOps profile. So the first real run printed "member ID (unknown)". connectionData returns the authenticated identity's ID for an app too. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WnuvVWAw3JVLjD8xRduLfK --- .github/workflows/release.yml | 12 +++++++----- RELEASING.md | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03e519f..ecf8b2a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -395,15 +395,17 @@ jobs: client-id: ${{ vars.AZURE_CLIENT_ID }} tenant-id: ${{ vars.AZURE_TENANT_ID }} allow-no-subscriptions: true - # the Entra ID identity must be a Contributor on the publisher; until it is, say which identity to add + # the Entra ID identity must be a Contributor on the publisher; until it is, say which identity to add. + # Its ID comes from connectionData, not profiles/me: an app (service principal) has no Azure DevOps + # profile, so profiles/me answers VSS011031. - name: Check Marketplace access if: steps.published.outputs.vscode_marketplace != 'true' run: | if npx --yes @vscode/vsce@4.0.0 verify-pat --azure-credential stringutilitybelt; then exit 0; fi - profile="$(az rest --method get --resource 499b84ac-1321-427f-aa17-267ca6975798 \ - --url 'https://app.vssps.visualstudio.com/_apis/profile/profiles/me?api-version=7.1-preview.3' \ - --query id --output tsv || true)" - echo "::error::This identity can't publish as stringutilitybelt. Add member ID ${profile:-(unknown)} to the publisher as a Contributor (RELEASING.md, VS Code Marketplace), then re-run this job." + member="$(az rest --method get --resource 499b84ac-1321-427f-aa17-267ca6975798 \ + --url 'https://app.vssps.visualstudio.com/_apis/connectionData' \ + --query authenticatedUser.id --output tsv || true)" + echo "::error::This identity can't publish as stringutilitybelt. Add member ID ${member:-(unknown)} to the publisher as a Contributor (RELEASING.md, VS Code Marketplace), then re-run this job." exit 1 - name: Publish to the VS Code Marketplace if: steps.published.outputs.vscode_marketplace != 'true' diff --git a/RELEASING.md b/RELEASING.md index 06fe902..da5d832 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -260,7 +260,7 @@ no Azure subscription is needed. 4. Make the app a member of the publisher. The Marketplace adds members by their Azure DevOps ID, which only the app itself can look up, so let the workflow do it: run a release (any run that includes `vscode`). Its **Check Marketplace access** step fails with *Add member ID `` to the - publisher*. Open + publisher*: the app's Azure DevOps identity, not its client ID. Open [the publisher's page](https://marketplace.visualstudio.com/manage/publishers/stringutilitybelt) → **Members → Add**, paste the ID, role **Contributor**, add, and **Re-run failed jobs**. If the `stringutilitybelt` publisher doesn't exist yet, create it there first.