Skip to content

Enable pipeline token/placeholder substitution in publish pipeline (APIOps Toolkit parity) #117

@petehauge

Description

@petehauge

Problem

APIOps CLI does not currently support token/placeholder substitution in the publish pipeline. APIOps Toolkit supports this, and users migrating from Toolkit to CLI expect to use their existing configuration files (e.g., configuration.prod.yaml) that contain placeholder tokens.

Background (APIOps Toolkit behavior)

In APIOps Toolkit, users can define placeholders in their configuration YAML files using the {#[TOKEN_NAME]#} syntax. For example:

apimServiceName: apim-prod-service
namedValues:
  - name: my-api-secret
    properties:
      displayName: my-api-secret
      secret: true
      value: "{#[PROD_SECRET_VALUE]#}"

The workflow is:

  1. Define placeholders in configuration YAML using {#[TOKEN_NAME]#} syntax
  2. Inject via pipeline secrets — store actual values in GitHub Actions Secrets (environment secrets) or Azure DevOps (secret variable groups), and map them to environment variables
  3. Token replacement step — before the publisher runs, a replacement step swaps {#[PROD_SECRET_VALUE]#} with the actual pipeline secret value

Proposed Solution

Enable token/placeholder substitution in the pipeline scaffolded by apiops init, compatible with the {#[TOKEN_NAME]#} syntax used by APIOps Toolkit. This ensures:

  • Users can migrate from APIOps Toolkit to APIOps CLI without rewriting their configuration files
  • Secrets are never committed to the Git repository
  • The replacement happens before publish, so the publisher receives resolved plain-text values

Documentation

A dedicated doc should be written for this feature covering:

  • How the token/placeholder syntax works ({#[TOKEN_NAME]#})
  • Step-by-step setup for GitHub Actions (environment secrets → env vars → substitution)
  • Step-by-step setup for Azure DevOps (variable groups → substitution)
  • Migration guide for users coming from APIOps Toolkit
  • Examples with common use cases (named values, backend URLs, secrets)

Acceptance Criteria

  • The publish pipeline supports {#[TOKEN_NAME]#} placeholder syntax in configuration YAML files
  • Token substitution occurs before the publish step runs
  • Tokens are resolved from pipeline environment variables / secrets
  • Users can use existing APIOps Toolkit configuration files without modification
  • Documentation explains how to set up token substitution with both GitHub Actions and Azure DevOps
  • A dedicated doc is written covering syntax, setup for GitHub Actions & Azure DevOps, migration from Toolkit, and common examples

Metadata

Metadata

Assignees

Labels

go:needs-researchNeeds investigationsquadSquad triage inbox — Lead will assign to a membersquad:apimexpertAssigned to ApimExpert (🔵 APIM Expert)type:compatibility-issueCompatibility issue between ApiOps Toolkit and apiops-cli
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions