Azure / Azure/azure-rest-api-specs

[BUG] Virtual Network Gateways Learned Routes API doesn't return the response and LRO operation doesn't return Status

Open
#34,019 0 comments 0 reactions 0 assignees View on GitHub
bug Mgmt Network - VPN Gateway Service Attention
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/blob/main/specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/virtualNetworkGateway.json#L804

### API Spec version

2024-05-01

### Describe the bug

We are trying to call [getLearnedRoutes](https://learn.microsoft.com/en-us/rest/api/network-gateway/virtual-network-gateways/get-learned-routes?view=rest-network-gateway-2024-05-01&tabs=HTTP) API "POST https://management.azure.com/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Network/virtualNetworkGateways/xxx/getLearnedRoutes?api-version=2024-05-01" to get learned routes. But API always returns null value since this API is marked as LRO in Swagger. I assume this API should be non-LRO API since this API is GET call. And then I tried to invoke LRO Url "GET https://management.azure.com/subscriptions/xx-xx-xxx-xxx/providers/Microsoft.Network/locations/eastus/operationResults/xx-xx-x-xxx?api-version=2024-05-01" returned by getLearnedRoutes API call. Though API response returns the learned routes but it doesn't return Status. So we can't determine whether API request is completed.

### Expected behavior

Either getLearnedRoutes API (POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/getLearnedRoutes?api-version=2024-05-01) is marked as non-LRO API and returns the learned routes with ProvisioningState or LRO Url "GET https://management.azure.com/subscriptions/xx-xx-xxx-xxx/providers/Microsoft.Network/locations/eastus/operationResults/xx-xx-x-xxx?api-version=2024-05-01" returns Status.

### Actual behavior

1. getLearnedRoutes API (POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/vpngw/getLearnedRoutes?api-version=2024-05-01) doesn't return the learned routes with ProvisioningState.
2. LRO Url "GET https://management.azure.com/subscriptions/xx-xx-xxx-xxx/providers/Microsoft.Network/locations/eastus/operationResults/xx-xx-x-xxx?api-version=2024-05-01" doesn't return Status.

### Reproduction Steps

1. Create Resource Group
2. Create Virtual Network
3. Create Subnet
4. Create two Public IPs
5. Create Virtual Network Gateway
6. Invoke [getLearnedRoutes](https://learn.microsoft.com/en-us/rest/api/network-gateway/virtual-network-gateways/get-learned-routes?view=rest-network-gateway-2024-05-01&tabs=HTTP) API to get learned routes with ProvisioningState.

### Environment

PROD

Contributor guide

Open the contributing guide

Research direction

Start with specification/network/resource-manager/Microsoft.Network/stable/2024-05-01/virtualNetworkGateway.json at the getLearnedRoutes operation, then compare its documented response and LRO metadata with the two reported endpoint responses. Check the associated REST API guidance before deciding which contract is intended; done means the specification accurately describes the learned-routes response and operation status behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.