Azure / Azure/azure-rest-api-specs

Microsoft.MarketplaceOrdering: cannot cancel or delete Anthropic Claude (Foundry) agreement after publisher withdraws plan from catalog

Open
#43,601 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 37m
Merged PRs (30d)
446

Description

## Summary

After deploying Claude on Azure AI Foundry and then tearing down the deployment, the underlying `Microsoft.MarketplaceOrdering` agreement for the Anthropic plan is left `Active` and **cannot be cancelled or deleted** by the customer. Every mutating call returns `400 BadRequest`:

```
"The Publisher: 'anthropic' does not make available Offer: 'anthropic-claude-sonnet-4-6-offer',
Plan: 'anthropic-claude-sonnet-4-6-test-plan' in your Subscription/Azure account's region: 'Neutral'."
```

The plan was withdrawn from the Marketplace catalog by the publisher. The RP validates `cancel` / `delete` against the live catalog, so once the plan is gone the customer's agreement is stranded indefinitely.

## API

`Microsoft.MarketplaceOrdering` — `MarketplaceAgreements_Cancel` / `_Delete` / `_Get`:

```
POST /subscriptions/{sub}/providers/Microsoft.MarketplaceOrdering/agreements/{publisher}/offers/{offer}/plans/{plan}/cancel?api-version=2021-01-01
DELETE /subscriptions/{sub}/providers/Microsoft.MarketplaceOrdering/agreements/{publisher}/offers/{offer}/plans/{plan}?api-version=2021-01-01
```

Spec: `specification/marketplaceordering/`. Reproduces on `2015-06-01` too.

Note: Foundry Claude deployments auto-sign this agreement via `Microsoft.CognitiveServices` during the first model deployment — customers often don't realize they signed it until they try to clean up.

## Repro

1. Deploy Claude on Foundry (`Microsoft.CognitiveServices/accounts/.../deployments`), which auto-signs the underlying `Microsoft.MarketplaceOrdering` agreement.
2. Tear down the Foundry account.
3. Publisher later rotates / withdraws the plan from the catalog.
4. `az rest --method post --url .../cancel?api-version=2021-01-01` → `400 BadRequest` (above).
5. `DELETE` on the agreement → same error. Portal Cancel button → same error.
6. Collection `GET` still returns the agreement as `Active`; only the single-resource `GET` and all mutations fail.

Live correlation IDs (2026-05-28, plan `anthropic-claude-sonnet-4-6-test-plan`): `0fa3ab6f-3087-4557-9b30-a5791abe988d`, `c393bc9b-7ed1-429a-a056-699d6c9c2e2d`, `e4c81638-ccab-45b3-b6fb-66a684bb2451`. Another plan on the same offer (`-plan-new`) cancelled normally moments earlier — isolating the failure to catalog withdrawal.

## Expected

`cancel` and `delete` on an agreement the customer owns should succeed unconditionally. The agreement record is subscription-scoped data; its lifecycle should not depend on whether the publisher still lists the plan.

## Impact

- Customers cannot clean up Claude/Foundry marketplace agreements after teardown — `azd down` / CI teardown / compliance scans can never reach zero active agreements.
- Only workaround is a manual support ticket per stranded agreement.
- Will recur for every Anthropic / other AI-MaaS plan-id rotation; scales with Foundry adoption.

## Suggested fix

In `Microsoft.MarketplaceOrdering`, skip the publisher-catalog lookup on `cancel`, `delete`, and single-resource `get`. The agreement either exists in the customer's subscription or it doesn't.

Same component / service team as #12838.

Contributor guide

Open the contributing guide

Research direction

Start in specification/marketplaceordering/ by reading the definitions for MarketplaceAgreements_Cancel, MarketplaceAgreements_Delete, and single-resource GET, comparing the 2021-01-01 and 2015-06-01 behavior described here. The fix is done when an existing subscription-scoped agreement can be retrieved, cancelled, or deleted after its publisher withdraws the plan, without catalog validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.