You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FEATURE: apiops compare to compare two apim instances #22
Compare should compare two API Management instances and report back the differences between the two. Users can use the compare command to verify deployments or investigate differences in different environments.
We should use compare-apiminstance.ps1 as a guide. It contains some of the nuances needed, like dealing with auto-generated identifiers.
Add an apiops compare command that compares two Azure API Management instances via the ARM REST API and reports differences. This enables users to verify deployments or investigate environment drift. The PowerShell script at tests/integration/all-resource-types/Compare-ApimInstance.ps1 serves as the reference implementation with all the special-case normalization logic.
Approach
Follow the existing command pattern (extract, publish, init) — a Commander subcommand, a service orchestrator, and shared infrastructure. The core challenge is normalization: two APIM instances will have different instance-specific values (subscription IDs, resource group names, service names, auto-generated IDs, timestamps, secrets) that must be neutralized before comparison.
Special Cases from PowerShell Reference
These are the normalization rules discovered from Compare-ApimInstance.ps1 that must be ported:
Then child resources enumerated from source: API children (operations, policies, schemas, tags, diagnostics, resolvers, releases, wikis, tag descriptions), operation policies, resolver policies
Product children (policies, APIs, groups, tags, wikis)
Reuse resource-path.ts: The normalizer must NOT reimplement ARM path parsing or template logic. It uses formatTemplatePath, parseTemplatePath, getNameFromNameParts, isSingletonType, isChildType, deriveListPaths from existing infrastructure.
Reuse resource-uri.ts: URL construction via buildArmUri() and labels via buildResourceLabel().
Reuse resource-types.ts: The existing data model (ResourceType enum, RESOURCE_TYPE_METADATA) already covers all 33 resource types — no new model needed.
Reuse IApimClient: listResources() and getResource() are sufficient for comparison; no client interface changes needed.
Issue:#22 — SPEC ISSUE: Design apiops compare to compare two apim instances Assigned to: ApimExpert (🔵 APIM Expert) Reason: Issue relates to backend/API work
changed the title [-]SPEC ISSUE: Design `apiops compare` to compare two apim instances[/-][+]FEATURE: `apiops compare` to compare two apim instances[/+]on May 29, 2026
Activity
EMaher commentedon May 4, 2026
Implementation Plan:
apiops compareCommandProblem Statement
Add an
apiops comparecommand that compares two Azure API Management instances via the ARM REST API and reports differences. This enables users to verify deployments or investigate environment drift. The PowerShell script attests/integration/all-resource-types/Compare-ApimInstance.ps1serves as the reference implementation with all the special-case normalization logic.Approach
Follow the existing command pattern (extract, publish, init) — a Commander subcommand, a service orchestrator, and shared infrastructure. The core challenge is normalization: two APIM instances will have different instance-specific values (subscription IDs, resource group names, service names, auto-generated IDs, timestamps, secrets) that must be neutralized before comparison.
Special Cases from PowerShell Reference
These are the normalization rules discovered from
Compare-ApimInstance.ps1that must be ported:1. Stripped Fields
id,type,name,systemData,etag— always removedpropertiesonly):provisioningState,createdAtUtc,lastModifiedDate,isCurrent,isOnline,stateComment,createdDatelastStatus,specificationLastUpdated,createdDateTime,updatedDateTime2. Instance-Specific String Normalization
/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.ApiManagement/service/{name}→ placeholderhttps://{vault}.vault.azure.net→ placeholdersrc-vstgt-) → placeholder{{auto-id}}{{guid}}3. Request/Response & Representation Handling
representationsarray: ignoredescription(WSDL/spec import generates varying descriptions)contentTypeorschemaId): ignoredescription,schemaId,typeName(spec-based publish doesn't populate these)4. Auto-Generated ID Matching
{{auto-id-0}},{{auto-id-1}}, etc.5. Resource-Specific Skip Rules
.properties.valuecomparison (secrets aren't extractable).properties.credentials(connection strings differ per instance)administrators,developers,guests; Productsstarter,unlimited; Subscriptionsmaster; APIsecho-api6. Hierarchical Comparison
Implementation Todos
CompareConfigto config typessrc/models/config.tsresource-path.ts/resource-uri.tsutilities)src/lib/compare-normalizer.tssrc/lib/compare-differ.tssrc/services/compare-service.tssrc/cli/compare-command.tssrc/cli/compare-command.tssrc/cli/index.tstests/unit/compare-normalizer.test.tstests/unit/compare-differ.test.tstests/unit/compare-service.test.tsspecs/contracts/cli-commands.mdKey Design Decisions
resource-path.ts: The normalizer must NOT reimplement ARM path parsing or template logic. It usesformatTemplatePath,parseTemplatePath,getNameFromNameParts,isSingletonType,isChildType,deriveListPathsfrom existing infrastructure.resource-uri.ts: URL construction viabuildArmUri()and labels viabuildResourceLabel().resource-types.ts: The existing data model (ResourceTypeenum,RESOURCE_TYPE_METADATA) already covers all 33 resource types — no new model needed.IApimClient:listResources()andgetResource()are sufficient for comparison; no client interface changes needed.CLI Interface
--subscription-idOR (--target-subscription-id <id>and--source-subscription-id)--subscription-id,--cloud,--format,--log-level, auth flags0= identical,1= differences found,2= fatal errorDependency Order
github-actions commentedon May 7, 2026
🏗️ Squad Triage — ApiOpsLead (🏗️ Tech Lead)
Issue: #22 — SPEC ISSUE: Design
apiops compareto compare two apim instancesAssigned to: ApimExpert (🔵 APIM Expert)
Reason: Issue relates to backend/API work
Team roster:
squad:apiopsleadsquad:apimexpertsquad:apicexpertsquad:typescriptdevsquad:nodejsdevsquad:testengineersquad:opensourceexpertsquad:codereviewersquad:azdoexpertsquad:githubexpertsquad:ralphfeat: fix TypeScript type safety in compare command (issue #22)
[-]SPEC ISSUE: Design `apiops compare` to compare two apim instances[/-][+]FEATURE: `apiops compare` to compare two apim instances[/+]github-actions commentedon Jun 29, 2026
It will be automatically closed after 60 days of inactivity.
To keep this issue open:
stalelabel.github-actions commentedon Sep 27, 2026
It will be automatically closed after 60 days of inactivity.
To keep this issue open:
stalelabel.