Azure / Azure/azure-rest-api-specs
[BUG] Microsoft.Peering API returns UTF-8 BOM prefix in JSON response body
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/tree/main/specification/peering/Peering.Management
### API Spec version
2025-05-01 (but all versions are affected - tested 2021-06-01 through 2025-05-01)
### Describe the bug
The `Microsoft.Peering/peerings` GET endpoint returns a UTF-8 BOM (`EF BB BF`) at the start of the JSON response body. This breaks any JSON parser that doesn't explicitly strip BOM (which is most of them: Go, Python, etc. all reject it).
We first noticed this on 2026-04-16 around 10:30-18:30 UTC. Before that, the same resources returned clean JSON without BOM. The resources themselves are healthy (`provisioningState: Succeeded`), it's just the encoding of the response that's wrong.
### Expected behavior
The API returns a JSON response starting with `{` and no BOM prefix.
```
00000000: 7b0a 2020 2022 736b 7522 ...
{ "sku":
```
### Actual behavior
The API returns 3 extra bytes (`EF BB BF`) before the JSON:
```
00000000: efbb bf7b 0a20 2022 736b 7522 ...
BOM { "sku":
```
Stripping the first 3 bytes gives valid JSON. So the response content itself is fine, it's just prefixed with a BOM that shouldn't be there.
### Reproduction Steps
```bash
az rest --method GET \
--url "https://management.azure.com/subscriptions/{sub-id}/resourceGroups/{rg}/providers/Microsoft.Peering/peerings/{name}?api-version=2025-05-01" \
--output-file /tmp/response.bin
xxd -l 4 /tmp/response.bin
# Expected: 7b0a 2020 ({...)
# Actual: efbb bf7b (BOM + {...)
```
### Environment
- Azure CLI 2.85.0
- Subscription region: Germany West Central
- Resources: multiple Exchange peerings across different resource groups
- Impact: `terraform-provider-azapi` can't read peering resources
Contributor guide
Research direction
Start with the Microsoft.Peering specification at specification/peering/Peering.Management and compare its response definition with the reported GET endpoint behavior. Reproduce the request using az rest and inspect the first four bytes with xxd. Done means confirming whether the specification can address the BOM behavior and recording a response that begins with { without EF BB BF, across the affected API versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100