Azure / Azure/azure-rest-api-specs

TrafficManager Endpoint should not include allOf ProxyResource

Open
#1,940 1 comment 1 reaction 0 assignees View on GitHub
Network - Traffic Manager Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

See related issue:
https://github.com/Azure/azure-cli/issues/4734

If you GET a traffic manager profile and try and PUT it back (which should succeed) you get the following error:
```
Endpoint name '' is invalid. Endpoint names cannot be empty or all whitespace, and must be up to 260 alphanumeric characters long. The type '' specified for endpoint '' is invalid. Valid endpoint types are: 'Microsoft.Network/trafficManagerProfiles/azureEndpoints', 'Microsoft.Network/trafficManagerProfiles/externalEndpoints', 'Microsoft.Network/trafficManagerProfiles/nestedEndpoints'.
```

The reason this happens is because of:
https://github.com/Azure/azure-rest-api-specs/blob/147b490417f4a8650dd307fadf9ba59da2e3bcfe/specification/trafficmanager/resource-manager/Microsoft.Network/2017-05-01/trafficmanager.json#L776-L779

Since Endpoint is considered a ProxyResource, name, type and id are marked read only. When the endpoint collection of the profile is serialized for the PUT call, the endpoint name and type are stripped out because the serializer sees them as readonly properties, but the service then rejects them for missing required properties.

I tried using the PATCH operation instead, but this did not seem to work correctly. Any complex object types of the Profile seemed to observe PUT-like behavior rather than PATCH.

cc/ @johanste, @ravbhatnagar, @lmazuel, @salameer

Contributor guide

Open the contributing guide

Research direction

Read specification/trafficmanager/resource-manager/Microsoft.Network/2017-05-01/trafficmanager.json around lines 776-779 and review the related Azure CLI issue. Reproduce the GET-then-PUT scenario for a traffic manager profile and inspect how Endpoint fields are serialized. Done means the round trip preserves the required endpoint name and type so the service accepts the PUT.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, json, openapi
Domain
api, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.