Skip to content

Latest commit

Β 

History

History
98 lines (83 loc) Β· 5.48 KB

File metadata and controls

98 lines (83 loc) Β· 5.48 KB

APIops CLI Documentation

Manage Azure API Management as code β€” extract, version, and publish your APIM configuration with a single CLI.

Quick Links

Guide Description
Getting Started Install and run your first extract β†’ publish cycle in 10 minutes
Command Reference Detailed docs for extract, publish, init, and API Center backup/restore
CI/CD Integration Set up GitHub Actions or Azure DevOps pipelines
Walkthroughs Step-by-step guides: Air-gapped GitHub Actions (local registry or offline tarball), Air-gapped Azure DevOps (local registry or offline tarball)

How It Works

flowchart LR
    A[Azure APIM Instance] -->|apiops extract| B[Local Artifact Files]
    B -->|git commit| C[Version Control]
    C -->|Review & Merge| D[CI/CD Pipeline]
    D -->|apiops publish| E[Target APIM Instance]
Loading
  1. Extract your APIM configuration into version-controlled files
  2. Review changes through pull requests β€” diffs, approvals, audit trail
  3. Publish to target environments with environment-specific overrides
  4. Automate with CI/CD for continuous, incremental deployments

Install

npm install -g @azure-tools/apiops-cli

Requires Node.js 22 or later.

Key Features

  • Full APIM coverage β€” APIs, products, backends, named values, policies, tags, subscriptions, gateways, and more
  • Filtered extraction β€” Extract specific APIs with automatic transitive dependency resolution
  • Environment overrides β€” Promote across dev/staging/prod with per-environment config
  • Incremental publish β€” Deploy only changed resources via git diff
  • Dry-run mode β€” Preview changes before applying them
  • CI/CD scaffolding β€” apiops init generates GitHub Actions or Azure DevOps pipelines
  • API Center backup and restore β€” apiops apic extracts and publishes Azure API Center resources and specifications
  • Token substitution β€” Replace {#[TOKEN_NAME]#} placeholders in config files with pipeline secrets before publish
  • Multiple auth methods β€” Azure CLI, managed identity, workload identity (OIDC), service principal

Documentation Structure

docs/
β”œβ”€β”€ README.md                          ← You are here
β”œβ”€β”€ getting-started.md                 β€” Quickstart guide
β”œβ”€β”€ commands/
β”‚   β”œβ”€β”€ extract.md                     β€” apiops extract reference
β”‚   β”œβ”€β”€ publish.md                     β€” apiops publish reference
β”‚   β”œβ”€β”€ init.md                        β€” apiops init reference
β”‚   └── apic.md                        β€” apiops apic reference
β”œβ”€β”€ guides/
β”‚   β”œβ”€β”€ scenarios-and-workflows.md     β€” Portal-first vs code-first workflows
β”‚   β”œβ”€β”€ authentication.md              β€” Auth methods for local dev and CI/CD
β”‚   β”œβ”€β”€ filtering.md                   β€” Filter extraction to specific APIs
β”‚   β”œβ”€β”€ environment-overrides.md       β€” Per-environment configuration
β”‚   β”œβ”€β”€ incremental-publish.md         β€” Deploy only changed resources
β”‚   β”œβ”€β”€ dry-run.md                     β€” Preview changes before publishing
β”‚   β”œβ”€β”€ multi-environment.md           β€” Dev / staging / prod promotion
β”‚   β”œβ”€β”€ multi-team-workflows.md        β€” Selective extraction, CODEOWNERS
β”‚   β”œβ”€β”€ code-first-workflow.md         β€” IDE β†’ git β†’ CI/CD β†’ APIM
β”‚   β”œβ”€β”€ token-substitution.md          β€” Pipeline token/placeholder substitution
β”‚   β”œβ”€β”€ prompt-files.md                β€” Copilot prompt files for APIOps tasks
β”‚   └── migration-from-v1.md           β€” Migrate from Azure/apiops toolkit
β”œβ”€β”€ ci-cd/
β”‚   β”œβ”€β”€ github-actions.md              β€” GitHub Actions integration
β”‚   β”œβ”€β”€ azure-devops.md                β€” Azure DevOps Pipelines integration
β”‚   └── authentication-patterns.md     β€” CI/CD auth (OIDC, service principal)
β”œβ”€β”€ reference/
β”‚   β”œβ”€β”€ artifact-format.md             β€” Directory layout and file structure
β”‚   β”œβ”€β”€ dependency-graph.md            β€” Transitive dependency resolution
β”‚   β”œβ”€β”€ resource-types.md              β€” Supported APIM resource types
β”‚   β”œβ”€β”€ configuration.md               β€” Config priority chain
β”‚   β”œβ”€β”€ apim-glossary.md               β€” APIM terminology primer
β”‚   └── exit-codes.md                  β€” CLI exit codes and meanings
β”œβ”€β”€ architecture/
β”‚   β”œβ”€β”€ overview.md                    β€” System design overview
β”‚   └── design-principles.md           β€” Architecture principles
β”œβ”€β”€ walkthrough/
β”‚   β”œβ”€β”€ air-gapped-github-actions.md                    β€” Using `apiops` in air-gapped CI/CD (GitHub Actions)
β”‚   β”œβ”€β”€ air-gapped-azure-devops.md                      β€” Using `apiops` in air-gapped CI/CD (Azure DevOps)
└── troubleshooting/
    β”œβ”€β”€ common-errors.md               β€” Error messages and solutions
    β”œβ”€β”€ debugging-guide.md             β€” Debugging with --log-level
    └── pipeline-recovery.md           β€” Recovering failed CI/CD runs

Next Steps

New to APIops CLI? Start with the Getting Started guide β€” you'll have a working extract β†’ publish cycle in 10 minutes.