Azure / Azure/azure-rest-api-specs
[BUG] Microsoft.EventHub 2024-01-01 messageRetentionInDays returning bogus value when tombstoneRetentionTimeInHour is set
- 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/63aa8b98c6674faa29b5d84dcdc1893830101a0a/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/eventhubs.json#L322
### API Spec version
2024-01-01
### Describe the bug
When `tombstoneRetentionTimeInHours` under `RetentionDescription` is set, and no value is given for `messageRetentionInDays`, the API will return a bogus value which exceeds the max of int64. Here is the request and response:
```
PUT https: //management.azure.com/subscriptions/79133cc5-0525-4c13-9cca-4298eca1d3e1/resourceGroups/acctestRG-eventhub-250718102148364875/providers/Microsoft.EventHub/namespaces/acctest-EHN-250718102148364875/eventhubs/acctest-EH-250718102148364875?api-version=2024-01-01 HTTP/1.1
Host: management.azure.com
User-Agent: HashiCorp/go-azure-sdk (Go-http-Client/1.1 eventhubs/2024-01-01) HashiCorp Terraform/1.9.4 (+https: //www.terraform.io) terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Length: 138
Authorization:
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: cf6fbbe0-a196-5d31-160b-b3c1390efcbf
Accept-Encoding: gzip
{
"properties": {
"partitionCount": 2,
"retentionDescription": {
"cleanupPolicy": "Compact",
"tombstoneRetentionTimeInHours": 7
},
"status": "Active"
}
}
```
API response:
```
{
"id": "/subscriptions/79133cc5-0525-4c13-9cca-4298eca1d3e1/resourceGroups/acctestRG-eventhub-250718102148364875/providers/Microsoft.EventHub/namespaces/acctest-EHN-250718102148364875/eventhubs/acctest-EH-250718102148364875",
"name": "acctest-EH-250718102148364875",
"type": "Microsoft.EventHub/namespaces/eventhubs",
"location": "eastus",
"properties": {
"retentionDescription": {
"cleanupPolicy": "Compact",
"tombstoneRetentionTimeInHours": 7
},
"messageRetentionInDays": 9223372036854775807,
"partitionCount": 2,
"status": "Active",
"createdAt": "2025-07-18T02:23:25.69Z",
"updatedAt": "2025-07-18T02:23:26.01Z",
"partitionIds": [
"0",
"1"
]
}
}
```
### Expected behavior
The value of `messageRetentionInDays` should indicate it's not set, like null.
### Actual behavior
The API gives a bogus value which panics the SDK.
### Reproduction Steps
Send a payload with `tombstoneRetentionTimeInHours` set.
### Environment
_No response_
Contributor guide
Research direction
Inspect specification/eventhub/resource-manager/Microsoft.EventHub/stable/2024-01-01/eventhubs.json around line 322, especially RetentionDescription and messageRetentionInDays. Reproduce the documented request with tombstoneRetentionTimeInHours set and verify how an omitted messageRetentionInDays is represented. Done means the API contract and observed response no longer expose the out-of-range sentinel as a configured value, and the SDK does not panic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100