From 545cec6dbbde4aad22da78a307f6fff9993c783b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 08:02:41 +0000 Subject: [PATCH 1/4] Initial plan From 6d7d684474a47cd0aaabedb4680208e69f509d23 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 08:07:34 +0000 Subject: [PATCH 2/4] Document supported CLI environment variables --- docs/commands/extract.md | 1 + docs/commands/publish.md | 3 +++ docs/reference/configuration.md | 2 ++ 3 files changed, 6 insertions(+) diff --git a/docs/commands/extract.md b/docs/commands/extract.md index cbb0ba4..f90f109 100644 --- a/docs/commands/extract.md +++ b/docs/commands/extract.md @@ -75,6 +75,7 @@ apiops extract \ | `--subscription-id ` | string | env: `AZURE_SUBSCRIPTION_ID` | Azure subscription ID (required) | | `--log-level ` | string | `info` | Log level: `debug`, `info`, `warn`, `error` | | `--format ` | string | `text` | Output format: `text` or `json` | +| `--api-version ` | string | `2024-05-01` (env: `AZURE_API_VERSION`) | APIM REST API version override | | `--cloud ` | string | `public` | Sovereign cloud: `public`, `china`, `usgov`, `germany` | | `--client-id ` | string | — | Service principal client ID | | `--client-secret ` | string | — | Service principal client secret | diff --git a/docs/commands/publish.md b/docs/commands/publish.md index 3e5a473..d2777d9 100644 --- a/docs/commands/publish.md +++ b/docs/commands/publish.md @@ -86,6 +86,7 @@ apiops publish \ | `--subscription-id ` | string | env: `AZURE_SUBSCRIPTION_ID` | Azure subscription ID (required) | | `--log-level ` | string | `info` | Log level: `debug`, `info`, `warn`, `error` | | `--format ` | string | `text` | Output format: `text` or `json` | +| `--api-version ` | string | `2024-05-01` (env: `AZURE_API_VERSION`) | APIM REST API version override | | `--cloud ` | string | `public` | Sovereign cloud: `public`, `china`, `usgov`, `germany` | | `--client-id ` | string | — | Service principal client ID | | `--client-secret ` | string | — | Service principal client secret | @@ -162,6 +163,8 @@ In CI/CD pipelines, this is typically set automatically: - run: npx apiops publish --commit-id ${{ github.event.before }} ``` +When both are provided, `--commit-id` takes precedence over `COMMIT_ID`. + > **Tip:** Incremental publish cannot be combined with `--delete-unmatched` because delete-unmatched requires a full comparison between source and APIM. ## Dry run diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index ba2405d..2cba528 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -88,6 +88,8 @@ Available on all commands (`extract`, `publish`, `init`): | `AZURE_TENANT_ID` | all | Microsoft Entra ID (Azure AD) tenant ID | | `AZURE_API_VERSION` | extract, publish | APIM REST API version (default: `2024-05-01`) | | `COMMIT_ID` | publish | Git commit SHA for incremental publish (alternative to `--commit-id`) | +| `OTEL_EXPORTER_OTLP_ENDPOINT` | extract, publish | OpenTelemetry OTLP exporter endpoint for telemetry | +| `APPLICATIONINSIGHTS_CONNECTION_STRING` | extract, publish | Azure Monitor Application Insights connection string for telemetry | ### Authentication Environment Variables From f01cdcfcb72afd5e02b37626abe46609711403b0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 17:59:51 +0000 Subject: [PATCH 3/4] Align docs and comments with preview API version default --- docs/commands/extract.md | 1 - docs/commands/publish.md | 1 - docs/reference/configuration.md | 8 +++----- src/cli/extract-command.ts | 6 +++--- src/cli/publish-command.ts | 6 +++--- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/docs/commands/extract.md b/docs/commands/extract.md index f90f109..cbb0ba4 100644 --- a/docs/commands/extract.md +++ b/docs/commands/extract.md @@ -75,7 +75,6 @@ apiops extract \ | `--subscription-id ` | string | env: `AZURE_SUBSCRIPTION_ID` | Azure subscription ID (required) | | `--log-level ` | string | `info` | Log level: `debug`, `info`, `warn`, `error` | | `--format ` | string | `text` | Output format: `text` or `json` | -| `--api-version ` | string | `2024-05-01` (env: `AZURE_API_VERSION`) | APIM REST API version override | | `--cloud ` | string | `public` | Sovereign cloud: `public`, `china`, `usgov`, `germany` | | `--client-id ` | string | — | Service principal client ID | | `--client-secret ` | string | — | Service principal client secret | diff --git a/docs/commands/publish.md b/docs/commands/publish.md index d2777d9..23d0dbf 100644 --- a/docs/commands/publish.md +++ b/docs/commands/publish.md @@ -86,7 +86,6 @@ apiops publish \ | `--subscription-id ` | string | env: `AZURE_SUBSCRIPTION_ID` | Azure subscription ID (required) | | `--log-level ` | string | `info` | Log level: `debug`, `info`, `warn`, `error` | | `--format ` | string | `text` | Output format: `text` or `json` | -| `--api-version ` | string | `2024-05-01` (env: `AZURE_API_VERSION`) | APIM REST API version override | | `--cloud ` | string | `public` | Sovereign cloud: `public`, `china`, `usgov`, `germany` | | `--client-id ` | string | — | Service principal client ID | | `--client-secret ` | string | — | Service principal client secret | diff --git a/docs/reference/configuration.md b/docs/reference/configuration.md index 2cba528..0db225e 100644 --- a/docs/reference/configuration.md +++ b/docs/reference/configuration.md @@ -39,7 +39,7 @@ Available on all commands (`extract`, `publish`, `init`): | `--cloud ` | Azure cloud environment | `public` | | `--log-level ` | Log verbosity: `debug`, `info`, `warn`, `error` | `info` | | `--format ` | Output format | `text` | -| `--api-version ` | APIM REST API version | `2024-05-01` | +| `--api-version ` | APIM REST API version | `2025-09-01-preview` | ### `apiops extract` Flags @@ -86,10 +86,8 @@ Available on all commands (`extract`, `publish`, `init`): | `AZURE_CLIENT_ID` | all | Service principal client ID for authentication | | `AZURE_CLIENT_SECRET` | all | Service principal client secret for authentication | | `AZURE_TENANT_ID` | all | Microsoft Entra ID (Azure AD) tenant ID | -| `AZURE_API_VERSION` | extract, publish | APIM REST API version (default: `2024-05-01`) | +| `AZURE_API_VERSION` | extract, publish | APIM REST API version (default: `2025-09-01-preview`) | | `COMMIT_ID` | publish | Git commit SHA for incremental publish (alternative to `--commit-id`) | -| `OTEL_EXPORTER_OTLP_ENDPOINT` | extract, publish | OpenTelemetry OTLP exporter endpoint for telemetry | -| `APPLICATIONINSIGHTS_CONNECTION_STRING` | extract, publish | Azure Monitor Application Insights connection string for telemetry | ### Authentication Environment Variables @@ -151,7 +149,7 @@ backends: | Azure cloud | `public` | `--cloud` | | Log level | `info` | `--log-level` | | Output format | `text` | `--format` | -| API version | `2024-05-01` | `--api-version` or `AZURE_API_VERSION` | +| API version | `2025-09-01-preview` | `--api-version` or `AZURE_API_VERSION` | | Transitive deps | enabled | `--no-transitive` | | Dry run | disabled | `--dry-run` | | Delete unmatched | disabled | `--delete-unmatched` | diff --git a/src/cli/extract-command.ts b/src/cli/extract-command.ts index 3c086e9..41576ba 100644 --- a/src/cli/extract-command.ts +++ b/src/cli/extract-command.ts @@ -77,9 +77,9 @@ async function executeExtract( } // Build service context - // Default to a recent preview API version so newer resource types (e.g. - // MCP-typed APIs) are returned by ARM list endpoints. Older versions - // (e.g. 2024-05-01) silently omit MCP APIs from /apis. + // Default to 2025-09-01-preview so newer resource types (e.g. MCP-typed + // APIs) are returned by ARM list endpoints. Older versions (e.g. 2024-05-01) + // can silently omit MCP APIs from /apis. const apiVersion = globalOpts.apiVersion ?? process.env.AZURE_API_VERSION ?? '2025-09-01-preview'; const cloudName = globalOpts.cloud ?? 'public'; const cloudConfig = getCloudConfig(cloudName); diff --git a/src/cli/publish-command.ts b/src/cli/publish-command.ts index 3f8431f..c650bf6 100644 --- a/src/cli/publish-command.ts +++ b/src/cli/publish-command.ts @@ -89,9 +89,9 @@ async function executePublish( } // Build service context - // Default to a recent preview API version so newer resource types (e.g. - // MCP-typed APIs) are accepted by ARM. Older versions (e.g. 2024-05-01) - // reject MCP API payloads. + // Default to 2025-09-01-preview so newer resource types (e.g. MCP-typed + // APIs) are accepted by ARM. Older versions (e.g. 2024-05-01) can reject + // MCP API payloads. const apiVersion = globalOpts.apiVersion ?? process.env.AZURE_API_VERSION ?? '2025-09-01-preview'; const cloudName = globalOpts.cloud ?? 'public'; From a1e7387445a944c735b2a51e3013020448eeefce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 18:08:19 +0000 Subject: [PATCH 4/4] Revert docs/commands/publish.md to main state --- docs/commands/publish.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/commands/publish.md b/docs/commands/publish.md index 23d0dbf..3e5a473 100644 --- a/docs/commands/publish.md +++ b/docs/commands/publish.md @@ -162,8 +162,6 @@ In CI/CD pipelines, this is typically set automatically: - run: npx apiops publish --commit-id ${{ github.event.before }} ``` -When both are provided, `--commit-id` takes precedence over `COMMIT_ID`. - > **Tip:** Incremental publish cannot be combined with `--delete-unmatched` because delete-unmatched requires a full comparison between source and APIM. ## Dry run