Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.51k stars 4.93k forks source link

[BUG] `ApiCenter.Management` @ `2024-03-01` - `PUT` operation for Services requires SKU #29502

Open nnstt1 opened 2 weeks ago

nnstt1 commented 2 weeks ago

API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/main/specification/apicenter/ApiCenter.Management/Service.tsp

API Spec version

2024-03-01

Describe the bug

In the API Center API specification, there is no mention of SKU in the Create Or Update operation (PUT) for Services. However, if you do not specify the SKU in the request body, you cannot update the Services in API Center.

When SKU is not present

GPr35AzbsAAxRdx

When SKU is present

GPr39pbb0AA5O42

Expected behavior

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}?api-version=2024-03-01

Request body

{
  "location": "East US",
  "tags": {
    "foo": "bar"
  }
}

Response

{
    "type": "Microsoft.ApiCenter/services",
    "location": "East US",
    "sku": {
        "name": "Free"
    },
    "properties": {},
    "id": "/subscriptions/{{subscriptionId}}/resourceGroups/{{resourceGroupName}}/providers/Microsoft.ApiCenter/services/{{serviceName}}",
    "name": "{{serviceName}}",
    "tags": {
        "foo": "bar"
    },
    "systemData": {
        "createdAt": "2024-06-03T17:34:20.5622751Z",
        "lastModifiedAt": "2024-06-19T13:29:55.4211607Z"
    }
}

Actual behavior

Response

{
    "code": "ValidationError",
    "message": "The Sku property on the given model is null. A valid Sku is required to create or update an API Catalog."
}

Reproduction Steps

  1. Create API Center resource via Azure Portal
  2. Update API Center resource via REST API

Environment

No response

v-jiaodi commented 2 weeks ago

@markcowl please help take a look, thanks.