Azure / Azure/azure-rest-api-specs

[BUG] GET on an Private Marketplace non-existing offer should return 404

Open
#35,316 0 comments 1 reaction 0 assignees View on GitHub
bug customer-reported Marketplace Catalog Mgmt question Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

### API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2023-01-01/Marketplace.json

### API Spec version

2023-01-1

### Describe the bug

When making a GET request on a non-existing offer, Azure API returns `400: Bad request`.
This make it impossible to be integrated with Terraform and AzAPI provider (and other automation tools).

### Expected behavior

I suggest the API should return `404: Not Found`.
This would allow seamless integration with IaC tooling like Terraform and the AzAPI provider.

### Actual behavior

The API return `400: Bad Request`

```
az rest --method get -u https://management.azure.com/providers/Microsoft.Marketplace/privateStores/$TENANT_ID/collections/$TENANT_ID/offers/center-for-internet-security-inc.cis-ubuntu?api-version=2023-01-01
Bad Request({"error":{"code":"BadRequest","message":"Offer center-for-internet-security-inc.cis-ubuntu does not exist"}})
```

### Reproduction Steps

```
az rest --method get -u https://management.azure.com/providers/Microsoft.Marketplace/privateStores/$TENANT_ID/collections/$TENANT_ID/offers/center-for-internet-security-inc.cis-ubuntu?api-version=2023-01-01
Bad Request({"error":{"code":"BadRequest","message":"Offer center-for-internet-security-inc.cis-ubuntu does not exist"}})
```

### Environment

Azure CLI : 2.73.0

Contributor guide

Open the contributing guide

Research direction

Start with specification/marketplace/resource-manager/Microsoft.Marketplace/stable/2023-01-01/Marketplace.json and locate the private marketplace offers GET operation. Compare its documented responses with the reproduced 400 behavior and determine whether the specification can capture the intended 404 response; done means the appropriate API response behavior is clearly represented or the required service-side change is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi
Domain
api, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.