How azure/apiops-cli works
apiops is a CLI for extracting Azure API Management configuration into local artifacts, publishing artifacts back to APIM, and scaffolding CI/CD workflows. Its primary workflow runs from an extract or publish command through an orchestration service, resource-specific processing, and Azure/artifact-store operations. Separate branches support API Center backup/restore and repository initialization. The graph follows the sampled call references and README; some deeper publish stages and API Center wiring are documented but their source was not sampled.
Main entry points: extract-service.ts Extract orchestrator · publish-service.ts Publish orchestrator · artifact-store.ts Artifact store · apim-client.ts APIM REST client
Components 31
CLI entrypoints
- Command router
src/cli/index.ts - Extract command
src/cli/extract-command.ts - Publish command
src/cli/publish-command.ts - Init command
src/cli/init-command.ts - APIC commands
src/cli/apic-command.ts
APIM artifact workflow
- Extract orchestrator
src/services/extract-service.ts - Publish orchestrator
src/services/publish-service.ts - Resource extraction
src/services/resource-extractor.ts - API extraction
src/services/api-extractor.ts - Product extraction
src/services/product-extractor.ts - Dependency extraction
src/services/transitive-extractor.ts - API publishing
src/services/api-publisher.ts - Resource publishing
src/services/resource-publisher.ts - Reference resolution
src/services/transitive-resolver.ts - Unmatched deletion
src/services/delete-unmatched-service.ts - Resource filtering
src/services/filter-service.ts - Dependency ordering
src/lib/dependency-graph.ts - APIM REST client
src/clients/apim-client.ts - Artifact store
src/clients/artifact-store.ts - Artifact path mapping
src/lib/resource-path.ts - Configuration loading
src/lib/config-loader.ts - Resource catalog
src/models/resource-types.ts
API Center
- API Center operations
src/services/apic-extract-service.ts - API Center client
src/clients/apic-client.ts
Repository scaffolding
- Scaffold service
src/services/init-service.ts - CI workflow templates
src/templates
Other components
- CLI user
- Azure APIM
- Local artifacts
- Azure API Center
- Target repository
Connections 46
- CLI user → Command router: runs commands
README.md - Command router → Extract command: routes to
src/cli/index.ts - Command router → Publish command: routes to
src/cli/index.ts - Command router → Init command: routes to
src/cli/index.ts - Command router → APIC commands: routes to
src/cli/index.ts - Extract command → Extract orchestrator: invokes
src/cli/extract-command.ts - Publish command → Publish orchestrator: invokes
src/cli/publish-command.ts - Extract command → Resource filtering: configures
src/cli/extract-command.ts - Extract orchestrator → Resource extraction: dispatches
src/services/extract-service.ts - Extract orchestrator → API extraction: dispatches
src/services/extract-service.ts - Extract orchestrator → Product extraction: dispatches
src/services/extract-service.ts - Extract orchestrator → Dependency extraction: dispatches
src/services/extract-service.ts - Extract orchestrator → Resource filtering: uses
src/services/extract-service.ts - Extract orchestrator → Dependency ordering: orders resources
src/services/extract-service.ts - Resource extraction → APIM REST client: reads resources
- Resource extraction → Artifact store: writes artifacts
- API extraction → Artifact store: writes artifacts
- Product extraction → Artifact store: writes artifacts
- Dependency extraction → APIM REST client: reads dependencies
- Publish orchestrator → API publishing: dispatches
src/services/publish-service.ts - Publish orchestrator → Resource publishing: dispatches
src/services/publish-service.ts - Publish orchestrator → Reference resolution: scans references
src/services/publish-service.ts - Publish orchestrator → Unmatched deletion: computes deletions
src/services/publish-service.ts - Publish orchestrator → Resource filtering: uses
src/services/publish-service.ts - Publish orchestrator → Dependency ordering: orders resources
src/services/publish-service.ts - API publishing → APIM REST client: writes resources
- Resource publishing → APIM REST client: writes resources
- Unmatched deletion → APIM REST client: deletes resources
src/services/delete-unmatched-service.ts - Unmatched deletion → Artifact store: reads artifacts
src/services/delete-unmatched-service.ts - Reference resolution → Artifact store: scans artifacts
- Extract orchestrator → Artifact store: stores output
- Publish orchestrator → Artifact store: loads input
- APIM REST client → Azure APIM: calls REST API
README.md - Artifact store → Local artifacts: reads and writes
- Artifact path mapping → Resource catalog: maps resource metadata
src/lib/resource-path.ts - Extract orchestrator → Artifact path mapping: maps artifact paths
src/services/extract-service.ts - Publish orchestrator → Artifact path mapping: resolves names
src/services/publish-service.ts - Extract command → Configuration loading: loads configuration
src/cli/extract-command.ts - Publish command → Configuration loading: loads configuration
src/cli/publish-command.ts - APIC commands → API Center operations: runs backup or restore
- API Center operations → API Center client: uses client
- API Center operations → Local artifacts: backs up or restores
README.md - API Center client → Azure API Center: calls service API
- Init command → Scaffold service: scaffolds repository
- Scaffold service → CI workflow templates: renders templates
src/services/init-service.ts - Scaffold service → Target repository: writes scaffold
README.md