--delete-unmatched parameter doesn't delete some API's cleanly
@azaslonov is already working on this.
Since Jul 7, 2026.
Assessment
This issue has not been assessed yet.
Description
API's with revisions are not getting deleted from destination API Management when running pipeling with --delete-unmatched parameter.
Command:
apiops publish --resource-group xxxxxxxxxxxxxx --service-name prod-apim-uk-01 --subscription-id 00000000-0000-0000-0000-000000000000 --source C:\vsts-agent-win-x64-4.274.1_work\2\s\apim-artifacts --overrides C:\vsts-agent-win-x64-4.274.1_work\2\s\prod.yaml --delete-unmatched
61 2026-06-11T08:11:50.7868446Z 2026-06-11T08:11:50.784Z [ERROR] Failed to delete apis/ai-project-01: [{"name":"Error","message":"Async operation failed for apis/ai-project-01: [ValidationError] Cannot delete the current revision of an API.","stack":"Error: Async operation failed for apis/ai-project-01: [ValidationError] Cannot delete the current revision of an API.\n at ApimClient.pollAsyncOperation (file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/clients/apim-client.js:721:23)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ApimClient.deleteResource (file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/clients/apim-client.js:378:21)\n at async file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/services/publish-service.js:458:29\n at async ParallelRunner.executeTask (file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/lib/parallel-runner.js:54:27)"}]
62 2026-06-11T08:11:51.4674195Z ERROR DELETE api/ai-project-01: Async operation failed for apis/ai-project-01: [ValidationError] Cannot delete the current revision of an API.
63 2026-06-11T08:11:51.4674627Z DELETE api/ai-project-01;rev=2
65 2026-06-11T08:11:51.4675322Z DELETE api/m365-proxy
66 2026-06-11T08:11:51.4675539Z DELETE api/petproxy
67 2026-06-11T08:11:51.4675761Z DELETE product/openai-pilot
68 2026-06-11T08:11:51.4675989Z DELETE diagnostic/azuremonitor
69 2026-06-11T08:11:55.2375830Z 2026-06-11T08:11:55.234Z [ERROR] Failed to delete backends/ai-project-01-ai-endpoint: [{"name":"HttpError","message":"HTTP 400: {"error":{"code":"ValidationError","message":"Backend 'ai-project-01-ai-endpoint' is used by the following entities:\r\n/apis/ai-project-01;rev=1/policies/policy\r\n","details":null}}","stack":"HttpError: HTTP 400: {"error":{"code":"ValidationError","message":"Backend 'ai-project-01-ai-endpoint' is used by the following entities:\r\n/apis/ai-project-01;rev=1/policies/policy\r\n","details":null}}\n at ApimClient.request (file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/clients/apim-client.js:167:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ApimClient.deleteResource (file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/clients/apim-client.js:370:30)\n at async file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/services/publish-service.js:458:29\n at async ParallelRunner.executeTask (file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/lib/parallel-runner.js:54:27)"}]
70 2026-06-11T08:12:03.7676613Z 2026-06-11T08:12:03.763Z [ERROR] Failed to delete namedValues/6a1eda3eb949c31708397423: [{"name":"HttpError","message":"HTTP 400: {"error":{"code":"ValidationError","message":"The Api Management Property '6a1eda3eb949c31708397423' is used by the following entities:\r\n/loggers/apim-uk-appinsights\r\n","details":null}}","stack":"HttpError: HTTP 400: {"error":{"code":"ValidationError","message":"The Api Management Property '6a1eda3eb949c31708397423' is used by the following entities:\r\n/loggers/apim-uk-appinsights\r\n","details":null}}\n at ApimClient.request (file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/clients/apim-client.js:167:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:104:5)\n at async ApimClient.deleteResource (file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/clients/apim-client.js:370:30)\n at async file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/services/publish-service.js:458:29\n at async ParallelRunner.executeTask (file:///C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/npm/node_modules/@peterhauge/apiops-cli/dist/lib/parallel-runner.js:54:27)"}]
71 2026-06-11T08:12:03.8089233Z ERROR DELETE backend/ai-project-01-ai-endpoint: HTTP 400: {"error":{"code":"ValidationError","message":"Backend 'ai-project-01-ai-endpoint' is used by the following entities:\r\n/apis/ai-project-01;rev=1/policies/policy\r\n","details":null}}
72 2026-06-11T08:12:03.8089978Z ERROR DELETE namedvalue/6a1eda3eb949c31708397423: HTTP 400: {"error":{"code":"ValidationError","message":"The Api Management Property '6a1eda3eb949c31708397423' is used by the following entities:\r\n/loggers/apim-uk-appinsights\r\n","details":null}}
- Dominant language
- TypeScript
- Stars
- 29
- Forks
- 10
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 22
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/apiops-cli
-
type:question
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Azure/apiops-cli#277 ·
-
type:documentation
Difficulty 1/5 Under an hour Newbie friendliness 94/100
Azure/apiops-cli#250 ·
-
Documentation P2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Azure/apiops-cli#24 · 1 comment ·
-
type:bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Azure/apiops-cli#291 ·
-
type:bug
Difficulty 3/5 1-2 days Newbie friendliness 58/100
Azure/apiops-cli#276 ·
All issues in Azure/apiops-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·