Azure / Azure/azure-rest-api-specs
Microsoft.Network/privateEndpoints@2021-03-01 privateLinkServiceConnections[ ].name is not marked as required
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
When creating privateEndpoints, and you specify privateLinkServiceConnections, the name property is not marked as required.
This causes an error when deployed to Azure, and provides no useful error description.
```json
{
"status": "Failed",
"error": {
"code": "InvalidRequestFormat",
"message": "Cannot parse the request.",
"details": []
}
}
```
The bicep code to replicate this issue can be seen below:
```bicep
resource pe 'Microsoft.Network/privateEndpoints@2021-03-01' = {
name: 'pe'
location: location
properties: {
subnet: {
id: resourceId('Microsoft.Network/virtualNetworks/subnets', vnet.name, 'snet')
}
privateLinkServiceConnections: [
{
properties: {
privateLinkServiceId: sqlServer.id
groupIds: [
'sqlServer'
]
}
}
]
}
}
```
Not specifying a value for the name property of a `privateLinkServiceConnections` object, does not show up as warnings through IntelliSense.
I was able to identify where in the swagger spec the property is defined:
https://github.com/Azure/azure-rest-api-specs/blob/32652d34b63d39b2c9ca52cf97e2f805b881dd4a/specification/network/resource-manager/Microsoft.Network/stable/2021-03-01/privateEndpoint.json#L762-L765
Contributor guide
Research direction
Open the linked specification/network/resource-manager/Microsoft.Network/stable/2021-03-01/privateEndpoint.json file at lines 762-765 and inspect the privateLinkServiceConnections schema. Compare its property declarations with the Bicep reproduction, then check the repository's specification validation; done means the missing name requirement is represented and omission is surfaced before deployment.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100