Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/ci-cd/azure-devops.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The extract pipeline pulls configuration from your APIM instance, publishes the

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `CONFIGURATION_YAML_PATH` | string | `Extract All APIs` | Choose `Extract All APIs` for a full extract, or `configuration.extract.yaml` to use a [filter file](../guides/filtering-resources.md) |
| `CONFIGURATION_YAML_PATH` | string | `Extract All APIs` | Choose `Extract All APIs` for a full extract, or `configuration.extractor.yaml` to use a [filter file](../guides/filtering-resources.md) |
| `resourceGroup` | string | `$(APIM_RESOURCE_GROUP)` | Azure resource group containing your APIM instance |
| `serviceName` | string | `$(APIM_SERVICE_NAME)` | Name of the APIM service instance |

Expand All @@ -55,7 +55,7 @@ flowchart TD
B --> C[npm ci]
C --> D{Configuration choice?}
D -->|Extract All APIs| E[apiops extract --resource-group ... --service-name ...]
D -->|configuration.extract.yaml| F[apiops extract ... --filter configuration.extract.yaml]
D -->|configuration.extractor.yaml| F[apiops extract ... --filter configuration.extractor.yaml]
E --> G[Publish pipeline artifact]
F --> G
G --> H[Create branch apim-extract-BuildId]
Expand Down Expand Up @@ -92,7 +92,7 @@ The key task is `AzureCLI@2`, which authenticates using your service connection:
--subscription-id $(AZURE_SUBSCRIPTION_ID)
```

When the filter option is selected, `--filter configuration.extract.yaml` is added to the command.
When the filter option is selected, `--filter configuration.extractor.yaml` is added to the command.

> **Why AzureCLI@2?** This task injects Azure credentials into the shell environment, allowing `apiops extract` to authenticate via `DefaultAzureCredential`. See [Authentication Guide](../guides/authentication.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/ci-cd/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The extract workflow pulls configuration from your APIM instance and creates a P
| Input | Description | Options |
|-------|-------------|---------|
| `ENVIRONMENT` | Which APIM instance to extract from | `dev`, `prod` |
| `CONFIGURATION_YAML_PATH` | Extract all APIs or use a filter file | `Extract All APIs`, `configuration.extract.yaml` |
| `CONFIGURATION_YAML_PATH` | Extract all APIs or use a filter file | `Extract All APIs`, `configuration.extractor.yaml` |

### What It Does

Expand Down
52 changes: 26 additions & 26 deletions docs/commands/extract.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ apiops extract \
--subscription-id 00000000-0000-0000-0000-000000000000 \
--resource-group my-rg \
--service-name my-apim \
--filter ./configuration.extract.yaml
--filter ./configuration.extractor.yaml
```

### Extract without transitive dependencies
Expand Down Expand Up @@ -98,23 +98,23 @@ By default, `apiops extract` exports **all** resources from the APIM instance (3
To extract only specific resources, pass a YAML filter file with `--filter`:

```yaml
# configuration.extract.yaml
apiNames:
# configuration.extractor.yaml
apis:
- echo-api
- petstore-api
productNames:
products:
- starter
backendNames:
backends:
- backend-api
namedValueNames:
namedValues:
- api-key
tagNames:
tags:
- production
policyFragmentNames:
policyFragments:
- rate-limit-fragment
loggerNames:
loggers:
- appinsights-logger
diagnosticNames:
diagnostics:
- applicationinsights
```

Expand All @@ -124,22 +124,22 @@ All 16 supported filter keys:

| Filter key | Resource type |
|------------|---------------|
| `apiNames` | APIs |
| `backendNames` | Backends |
| `productNames` | Products |
| `namedValueNames` | Named values |
| `loggerNames` | Loggers |
| `diagnosticNames` | Diagnostics |
| `tagNames` | Tags |
| `policyFragmentNames` | Policy fragments |
| `gatewayNames` | Gateways |
| `versionSetNames` | API version sets |
| `groupNames` | Groups |
| `subscriptionNames` | Subscriptions |
| `schemaNames` | Schemas |
| `policyRestrictionNames` | Policy restrictions |
| `documentationNames` | Documentation resources |
| `workspaceNames` | Workspaces |
| `apis` | APIs |
| `backends` | Backends |
| `products` | Products |
| `namedValues` | Named values |
| `loggers` | Loggers |
| `diagnostics` | Diagnostics |
| `tags` | Tags |
| `policyFragments` | Policy fragments |
| `gateways` | Gateways |
| `versionSets` | API version sets |
| `groups` | Groups |
| `subscriptions` | Subscriptions |
| `schemas` | Schemas |
| `policyRestrictions` | Policy restrictions |
| `documentations` | Documentation resources |
| `workspaces` | Workspaces |

### Transitive dependencies

Expand Down
6 changes: 2 additions & 4 deletions docs/commands/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ In interactive mode (the default when running in a terminal), `apiops init` prom
|------|---------|
| `.github/workflows/extract.yaml` | Pipeline to extract APIM artifacts |
| `.github/workflows/publish.yaml` | Pipeline to publish artifacts to APIM |
| `configuration.extract.yaml` | Sample filter configuration for extraction |
| `configuration.extractor.yaml` | Sample filter configuration for extraction |
| `configuration.{env}.yaml` | Override templates per environment (e.g., `configuration.dev.yaml`, `configuration.prod.yaml`) |
| `IDENTITY-SETUP-GITHUB.md` | Step-by-step guide for configuring federated credentials |

Expand All @@ -90,9 +90,7 @@ In interactive mode (the default when running in a terminal), `apiops init` prom
|------|---------|
| `pipelines/extract.yaml` | Pipeline to extract APIM artifacts |
| `pipelines/publish.yaml` | Pipeline to publish artifacts to APIM |
| `configuration.extract.yaml` | Sample filter configuration for extraction |
| `configuration.{env}.yaml` | Override templates per environment |
| `IDENTITY-SETUP-AZDO.md` | Step-by-step guide for configuring service connections |
| `configuration.extractor.yaml` | Sample filter configuration for extraction |

### Both platforms

Expand Down
76 changes: 38 additions & 38 deletions docs/guides/filtering-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ By default, `apiops extract` pulls every resource from your APIM instance. For l
1. Create a filter file:

```yaml
# configuration.extract.yaml
apiNames:
# configuration.extractor.yaml
apis:
- petstore-api
- orders-api
```
Expand All @@ -29,7 +29,7 @@ apiops extract \
--resource-group my-rg \
--service-name my-apim \
--subscription-id 00000000-0000-0000-0000-000000000000 \
--filter configuration.extract.yaml
--filter configuration.extractor.yaml
```

Only `petstore-api`, `orders-api`, and their transitive dependencies are extracted.
Expand All @@ -41,29 +41,29 @@ Only `petstore-api`, `orders-api`, and their transitive dependencies are extract
The filter file is a YAML document where each key is a resource type and the value is an array of resource names:

```yaml
# configuration.extract.yaml
# configuration.extractor.yaml

# APIs to extract (by display name or API ID)
apiNames:
apis:
- petstore-api
- orders-api

# Backends to include
backendNames:
backends:
- orders-backend

# Products to include
productNames:
products:
- starter
- enterprise

# Named values to include
namedValueNames:
namedValues:
- api-key
- connection-string

# Leave sections out (or comment them) to extract ALL of that type
# loggerNames:
# loggers:
# - appinsights
```

Expand All @@ -79,22 +79,22 @@ namedValueNames:

| Filter Field | APIM Resource | Example Values |
|-------------|---------------|----------------|
| `apiNames` | APIs | `petstore-api`, `orders-v2` |
| `backendNames` | Backends | `orders-backend`, `payment-service` |
| `productNames` | Products | `starter`, `enterprise`, `internal` |
| `namedValueNames` | Named Values | `api-key`, `db-connection-string` |
| `loggerNames` | Loggers | `appinsights-logger`, `eventhub-logger` |
| `diagnosticNames` | Diagnostics | `applicationinsights`, `azuremonitor` |
| `tagNames` | Tags | `production`, `beta`, `internal` |
| `policyFragmentNames` | Policy Fragments | `rate-limit-fragment`, `cors-policy` |
| `gatewayNames` | Self-hosted Gateways | `on-prem-gateway`, `edge-gateway` |
| `versionSetNames` | API Version Sets | `orders-version-set` |
| `groupNames` | Groups | `developers`, `partners`, `admins` |
| `subscriptionNames` | Subscriptions | `team-a-subscription` |
| `schemaNames` | Global Schemas | `shared-error-schema` |
| `policyRestrictionNames` | Policy Restrictions | `no-external-calls` |
| `documentationNames` | Documentation | `getting-started`, `changelog` |
| `workspaceNames` | Workspaces | `team-a-workspace`, `team-b-workspace` |
| `apis` | APIs | `petstore-api`, `orders-v2` |
| `backends` | Backends | `orders-backend`, `payment-service` |
| `products` | Products | `starter`, `enterprise`, `internal` |
| `namedValues` | Named Values | `api-key`, `db-connection-string` |
| `loggers` | Loggers | `appinsights-logger`, `eventhub-logger` |
| `diagnostics` | Diagnostics | `applicationinsights`, `azuremonitor` |
| `tags` | Tags | `production`, `beta`, `internal` |
| `policyFragments` | Policy Fragments | `rate-limit-fragment`, `cors-policy` |
| `gateways` | Self-hosted Gateways | `on-prem-gateway`, `edge-gateway` |
| `versionSets` | API Version Sets | `orders-version-set` |
| `groups` | Groups | `developers`, `partners`, `admins` |
| `subscriptions` | Subscriptions | `team-a-subscription` |
| `schemas` | Global Schemas | `shared-error-schema` |
| `policyRestrictions` | Policy Restrictions | `no-external-calls` |
| `documentations` | Documentation | `getting-started`, `changelog` |
| `workspaces` | Workspaces | `team-a-workspace`, `team-b-workspace` |

---

Expand All @@ -120,7 +120,7 @@ flowchart TD
Given this filter:

```yaml
apiNames:
apis:
- petstore-api
```

Expand Down Expand Up @@ -150,7 +150,7 @@ apiops extract \
--resource-group my-rg \
--service-name my-apim \
--subscription-id 00000000-0000-0000-0000-000000000000 \
--filter configuration.extract.yaml \
--filter configuration.extractor.yaml \
--no-transitive
```

Expand All @@ -170,8 +170,8 @@ apiops extract \
A team that owns one or two APIs:

```yaml
# configuration.extract.yaml
apiNames:
# configuration.extractor.yaml
apis:
- orders-api
- orders-admin-api
```
Expand All @@ -183,33 +183,33 @@ Transitive dependencies (backends, named values, policy fragments) are auto-incl
Extract everything associated with a product:

```yaml
# configuration.extract.yaml
productNames:
# configuration.extractor.yaml
products:
- enterprise
```

> **Note:** Filtering by `productNames` extracts the product definition and its associations, but does **not** transitively include the APIs in that product. To include the APIs, add them to `apiNames` as well.
> **Note:** Filtering by `products` extracts the product definition and its associations, but does **not** transitively include the APIs in that product. To include the APIs, add them to `apis` as well.

### Shared Infrastructure Team

A platform team managing cross-cutting resources:

```yaml
# configuration.extract.yaml
namedValueNames:
# configuration.extractor.yaml
namedValues:
- global-api-key
- rate-limit-threshold
- cors-allowed-origins

policyFragmentNames:
policyFragments:
- standard-rate-limit
- cors-policy
- auth-validation

loggerNames:
loggers:
- appinsights-logger

backendNames:
backends:
- identity-service
```

Expand All @@ -222,7 +222,7 @@ There is no "exclude" syntax. To extract everything except certain resources, li
## Tips

- **Start broad, narrow later** — Begin with no filter to see what's in your APIM instance, then create a filter for your team's slice
- **One filter per team** — In multi-team setups, each team maintains its own `configuration.extract.yaml`
- **One filter per team** — In multi-team setups, each team maintains its own `configuration.extractor.yaml`
- **Commit the filter file** — Keep it in version control alongside your artifacts so CI/CD pipelines can use it
- **Case-sensitive names** — Filter values must match APIM resource names exactly (usually lowercase with hyphens)
- **Validate early** — The config loader validates that each filter field is an array of strings and will throw `Failed to load filter config` on invalid YAML
Expand Down
Loading
Loading