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:
- Define placeholders in configuration YAML using
{#[TOKEN_NAME]#} syntax
- 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
- 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
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:The workflow is:
{#[TOKEN_NAME]#}syntax{#[PROD_SECRET_VALUE]#}with the actual pipeline secret valueProposed Solution
Enable token/placeholder substitution in the pipeline scaffolded by
apiops init, compatible with the{#[TOKEN_NAME]#}syntax used by APIOps Toolkit. This ensures:Documentation
A dedicated doc should be written for this feature covering:
{#[TOKEN_NAME]#})Acceptance Criteria
{#[TOKEN_NAME]#}placeholder syntax in configuration YAML files