Azure / Azure/azure-rest-api-specs
[BUG] CloudHsmClusters Patch operation defined as LRO but implementation is not
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 6k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/44319b51c6f952fdc9543d3dc4fdd9959350d102/specification/hardwaresecuritymodules/resource-manager/Microsoft.HardwareSecurityModules/stable/2025-03-31/openapi.json#L362-L410
### API Spec version
2025-03-31
### Describe the bug
The swagger definition of the Patch operation of CloudHSMCluster is a LRO, but the API doesn't return as LRO but `200` status code, and there is a statusMessage in the resource body indicate `Updating HSM cluster`:
```
PATCH https://management.azure.com/subscriptions/xxx/resourceGroups/acctestRG-cloudhsm-250801104638033346/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/acctest-hsm-fuvh0?api-version=2025-03-31 HTTP/2.0
x-ms-correlation-request-id: 8305450e-166c-78a3-65b1-8d5e88213cdf
{"identity":{"type":"UserAssigned","userAssignedIdentities":{"/subscriptions/xxx/resourceGroups/acctestRG-cloudhsm-250801104638033346/providers/Microsoft.ManagedIdentity/userAssignedIdentities/acctestuai-fuvh0":{}}},"tags":{"environment":"updated","purpose":"acceptance-testing"}}
HTTP/2.0 200
content-type: application/json; charset=utf-8
x-ms-request-id: 1327b793-2edf-4d69-8781-a8b78fe0dc05
strict-transport-security: max-age=31536000; includeSubDomains
x-ms-operation-identifier: appId=1c45ae43-15ad-473a-ae90-95b900838b9b,tenantId=213e87ed-8e08-4eb4-a63c-c073058f7b00,objectId=bdb0fe3a-b247-426d-ab29-452d91f88c80/eastus2/cd5e8e34-2f7a-4ea9-afb8-8f9f8b4012e9
x-ms-correlation-request-id: 8305450e-166c-78a3-65b1-8d5e88213cdf
x-ms-routing-request-id: EASTUS2:20250801T010353Z:04ab885c-e666-41a1-85c2-7c0d7308d646
x-msedge-ref: Ref A: CBBA028C32894FFBBF199E4B851B857B Ref B: SYD03EDGE0913 Ref C: 2025-08-01T01:03:50Z
date: Fri, 01 Aug 2025 01:03:53 GMT
{"name":"acctest-hsm-fuvh0","type":"Microsoft.HardwareSecurityModules/cloudHsmClusters","location":"eastus2","id":"/subscriptions/xxx/resourceGroups/acctestRG-cloudhsm-250801104638033346/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/acctest-hsm-fuvh0","sku":{"family":"B","name":"Standard_B1"},"properties":{"provisioningState":"Succeeded","statusMessage":"Updating HSM cluster","autoGeneratedDomainNameLabelScope":"TenantReuse","activationState":"NotActivated"}
```
### Expected behavior
The Patch API should return 202 and with a Location in response header for client to poll.
### Actual behavior
The API returns 200 for a LRO.
### Reproduction Steps
create a CloudHSM and then call Patch to update its tags or identity
### Environment
_No response_
Contributor guide
Research direction
Start with the CloudHsmClusters Patch operation in the linked openapi.json at lines 362-410, then reproduce the request against API version 2025-03-31 by creating a CloudHSM and updating its tags or identity. Compare the documented LRO response with the observed 200 response and statusMessage; done means the service behavior and specification agree about the response status and polling Location header.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100