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
Copy file name to clipboardExpand all lines: docs/architecture/overview.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,7 +161,7 @@ flowchart TD
161
161
-**Dry-run mode** — `--dry-run` compares local artifacts against live APIM state and outputs a change report without modifying anything.
162
162
-**Override merging** — Environment-specific override files are merged into artifact JSON before publishing, enabling promotion across environments (dev → staging → prod).
163
163
-**Topological ordering** — Resources are published in dependency order (e.g., named values before APIs that reference them).
164
-
-**Delete-unmatched** — Optionally removes APIM resources not present in the artifact source. Requires explicit opt-in and is mutually exclusive with `--commit-id`.
164
+
-**Delete-unmatched** — Optionally removes APIM resources not present in the artifact source. With `--commit-id`, it deletes only resources removed by the selected commit. All deletion requires explicit opt-in.
|`--filter <path>`| string | — | No | Filter YAML file shared with `extract`|
91
+
|`--no-transitive`| boolean |`false`| No | Publish only exact filter matches |
76
92
|`--commit-id <sha>`| string | env: `COMMIT_ID`| No | Git commit SHA for incremental publish |
77
93
|`--dry-run`| boolean |`false`| No | Preview changes without applying |
78
-
|`--delete-unmatched`| boolean |`false`| No | Delete APIM resources not present in source |
94
+
|`--delete-unmatched`| boolean |`false`| No | Delete APIM resources absent from source, or removed by an incremental commit|
79
95
80
-
> **Note:**`--commit-id`and `--delete-unmatched`are **mutually exclusive**. The CLI will error if both are specified.
96
+
> **Note:**`--filter` and `--commit-id`can be combined. `--delete-unmatched`cannot be combined with `--filter`; with `--commit-id`, it explicitly enables commit-scoped deletions.
81
97
82
98
### Global flags
83
99
@@ -168,7 +184,7 @@ In CI/CD pipelines, this is typically set automatically:
> **Tip:** Incremental publish cannot be combined with `--delete-unmatched` because delete-unmatched requires a full comparison between source and APIM.
187
+
> **Tip:** Incremental publish is non-destructive by default. Add `--delete-unmatched` to delete resources removed by the selected commit; omit `--commit-id` for a full unmatched-resource cleanup.
172
188
173
189
## Dry run
174
190
@@ -185,7 +201,7 @@ The output lists each resource and the planned action (create, update, or delete
185
201
186
202
## Delete unmatched
187
203
188
-
When `--delete-unmatched` is set, resources that exist in the APIM instance but are **not** present in the source artifacts are deleted. This enforces the source directory as the single source of truth.
204
+
For a full publish, `--delete-unmatched` deletes APIM resources that are **not** present in the source artifacts. With `--commit-id`, it deletes only resources and Product associations removed by the selected commit.
189
205
190
206
> **Warning:** Use with caution. Resources created manually in the Azure portal that are not in your artifact directory will be removed.
Copy file name to clipboardExpand all lines: docs/guides/filtering-resources.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Filtering Resources
2
2
3
-
By default, `apiops extract` pulls every resource from your APIM instance. For large instances or multi-team setups, you can filter extraction to specific resources using a YAML filter file.
3
+
By default, `apiops extract` pulls every resource from your APIM instance and `apiops publish` publishes every artifact in the source directory. For large instances or multi-team setups, you can use the same YAML filter file to limit either operation to specific resources.
4
4
5
5
## Why Filter?
6
6
@@ -34,6 +34,18 @@ apiops extract \
34
34
35
35
`petstore-api`, `orders-api`, and their transitive dependencies are extracted — along with every backend, named value, product, tag, workspace, and every other resource type, because those keys are omitted and therefore default to "include all". To narrow the extract to just these APIs, see [How To: Extract Just One API](#how-to-extract-just-one-api) below.
36
36
37
+
The same filter can limit publishing to a subset of the extracted artifacts:
38
+
39
+
```bash
40
+
apiops publish \
41
+
--resource-group my-rg \
42
+
--service-name my-apim \
43
+
--filter configuration.extractor.yaml
44
+
```
45
+
46
+
Referenced dependencies are included by default; add `--no-transitive` to publish only direct filter
Copy file name to clipboardExpand all lines: docs/guides/incremental-publish.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,17 +140,17 @@ Force a full publish (omit `--commit-id`) when:
140
140
- **Configuration drift** — someone changed APIM directly in the portal and you want to overwrite everything from git.
141
141
- **Major refactoring** — renaming many APIs or restructuring directories. A full publish ensures nothing is missed.
142
142
- **Override-only changes** — you updated an override file but no artifact files changed. See [Gotcha: Override-only changes are not published incrementally](environment-overrides.md#gotcha-override-only-changes-are-not-published-incrementally).
143
-
- **You need `--delete-unmatched`** — see below.
143
+
- **You need a full unmatched-resource cleanup** — incremental deletion only covers resources removed by the selected commit.
144
144
145
-
### `--commit-id` and `--delete-unmatched` are mutually exclusive
145
+
### Incremental deletion requires explicit opt-in
146
146
147
-
You cannot combine incremental publish with `--delete-unmatched`. The CLI exits with an error if both are specified.
147
+
By default, incremental publish does not delete resources. Add `--delete-unmatched` to delete resources whose artifacts or Product associations were removed by the selected commit:
148
148
149
-
```
150
-
Options --commit-id (or COMMIT_ID) and --delete-unmatched are mutually exclusive.
**Why?** `--delete-unmatched` removes APIM resources that don't exist in the artifact directory — it requires a full view of all artifacts. Incremental publish only sees one commit's diff.
153
+
This does not perform a full unmatched-resource scan. Omit `--commit-id` when you need to remove every APIM resource absent from the complete artifact source.
154
154
155
155
---
156
156
@@ -162,7 +162,7 @@ Options --commit-id (or COMMIT_ID) and --delete-unmatched are mutually exclusive
162
162
| `Commit <sha> not found; skipping incremental diff` | Shallow clone doesn't include the commit | Use `fetch-depth: 2` (or more) in your checkout step to include at least the parent commit. |
163
163
| Nothing published, no errors | Commit diff returned no artifact file changes | Verify the commit actually touches files in the `--source` directory. Use `git diff --name-status HEAD~1 HEAD` locally to check. |
164
164
| Nothing published after override change | Override file changed but no artifact files changed | Override files are not artifact files — they don't trigger resource selection. Run a full publish (omit `--commit-id`) or include an artifact file change in the same commit. See [Gotcha: Override-only changes](environment-overrides.md#gotcha-override-only-changes-are-not-published-incrementally). |
165
-
| `mutually exclusive` error | Both `--commit-id` and `--delete-unmatched` specified | Remove one. Use `--commit-id` for incremental or `--delete-unmatched` for full sync — not both. |
165
+
| Removed resources remain in APIM | Incremental deletion was not enabled | Add `--delete-unmatched` after reviewing a dry-run. |
Copy file name to clipboardExpand all lines: docs/reference/configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ Available on all commands (`extract`, `publish`, `init`):
63
63
|`--dry-run`| Preview changes without applying |`false`|
64
64
|`--delete-unmatched`| Delete resources not in artifacts |`false`|
65
65
66
-
> ⚠️ `--commit-id` and `--delete-unmatched` are **mutually exclusive**. You cannot use both.
66
+
> ⚠️ Incremental deletion is disabled unless `--delete-unmatched` is combined with `--commit-id`. The combination deletes only resources removed by the selected commit.
0 commit comments