Skip to content

Test on real Azure DevOps agents and publish to the Marketplace with Entra OIDC - #12

Merged
olljanat-ai merged 1 commit into
mainfrom
claude/tender-meitner-ajhg0z
Nov 12, 2026
Merged

olljanat-ai merged 1 commit into
mainfrom
claude/tender-meitner-ajhg0z

Conversation

@olljanat-ai

Copy link
Copy Markdown
Member

Summary

Adds an end-to-end test loop on real Azure DevOps agents, and Marketplace publishing, both authenticated with GitHub OIDC → Microsoft Entra service principal. No PAT or other secret is stored. Microsoft documents service principals publishing with an Entra token: command-line publishing, "Publish with a Microsoft Entra token".

Dev extension (scripts/package-azure.mjs)

  • --dev --patch N packages onek8s.container-build-dev with its own task ID and name (ContainerBuildDev) and version <major>.<minor>.N, so it can be installed next to the released extension.
  • npm run package:azure uses the same script for the normal package.

Workflow azure-devops-e2e.yml

Enabled by the repository variable ADO_ORGANIZATION. It runs for PRs from this repo, pushes to main and on demand. Runs are serialized, because Marketplace versions must increase and the org has one dev extension installed.

  1. Build and package the dev extension. The patch number is run_number * 100 + attempt.
  2. Sign in with azure/login using OIDC, environment azure-devops-e2e, then get a token for the Azure DevOps resource 499b84ac-….
  3. Print the service principal's profile id, which is needed to add it to the Marketplace publisher.
  4. tfx extension publish --share-with <org>.
  5. scripts/azure-devops-e2e.mjs:
    • waits until the org has exactly that version installed, installing or reinstalling it if needed
    • queues test/azure-devops/e2e.yml for the PR branch
    • waits for the run, and on failure prints the failed steps from the build timeline

Test pipeline test/azure-devops/e2e.yml

  • Push to ACR through a Docker Registry (ACR) service connection with workload identity federation, and verify the output variables (image, digest, vulnerabilities, sbom).
  • Push through an Azure Resource Manager service connection with workload identity federation (azureSubscription + registry).
  • A malicious npm package fails the build (safe-chain).
  • Optional: zero-config on a Managed DevOps Pool, where the VM tag supplies the registry and the managed identity does the login.

Release

  • release.yml publishes onek8s.container-build with the same service principal, using environment marketplace, as soon as AZURE_DEVOPS_CLIENT_ID is set. This replaces the AZURE_DEVOPS_MARKETPLACE_TOKEN secret.

Setup

  • scripts/setup-azure-devops-e2e.sh creates the Entra app and service principal, federated credentials for both GitHub environments, and optionally a test ACR.
  • docs/azure-devops-e2e.md covers the Marketplace publisher, the Azure DevOps org (service principal user, extension manager, service connections, pipeline) and the GitHub variables.

Testing

  • 93 unit tests. New cases:
    • orchestration against a fake Azure DevOps API: waiting for the version, installing when missing, queue request body, Bearer auth, reporting failed timeline records, required settings
    • the dev-variant rewrite
  • The dev .vsix was built and inspected: its own extension ID and version, and the task ID, name and version from the patch number.
  • All YAML parses, and bash -n passes on the setup script.
  • Not run against a real Azure DevOps organization yet. That needs the setup in docs/azure-devops-e2e.md. Until ADO_ORGANIZATION is set the new workflow is skipped, and the release publishing step stays off until AZURE_DEVOPS_CLIENT_ID is set.

Generated by Claude Code

- Package a dev variant of the extension (onek8s.container-build-dev,
  task ContainerBuildDev, own ids, increasing patch version)
- New workflow: GitHub OIDC -> Entra service principal -> Azure DevOps
  token; publish the dev extension privately to the test organization,
  wait until it is installed, queue test/azure-devops/e2e.yml and wait
  for the result (failed steps are reported)
- Test pipeline: ACR via Docker Registry and Azure Resource Manager
  service connections with workload identity federation, malware block,
  and optionally zero-config on a Managed DevOps Pool
- Release workflow publishes to the Marketplace with the same OIDC
  service principal instead of a PAT secret
- Setup script for the Entra app/federated credentials and test ACR,
  and docs/azure-devops-e2e.md for the Azure DevOps and Marketplace steps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HpAsQazVvi679PqLz7o1C1
@olljanat-ai
olljanat-ai merged commit b37a9af into main Nov 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants