Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.69k stars 5.12k forks source link

Virtual Network operations return 200 with Azure-AsyncOperation #12828

Open jiasli opened 3 years ago

jiasli commented 3 years ago

The REST spec says 200 is returned for "Update successful":

https://github.com/Azure/azure-rest-api-specs/blob/494de57a286ed23d6f7ff7251b79db96dafa6f05/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/virtualNetwork.json#L191-L197

Public doc: https://docs.microsoft.com/en-us/rest/api/virtualnetwork/virtualnetworks/createorupdate#response

When I am updating the virtualNetworks, I got 200 with Azure-AsyncOperation in the response header:

> az network vnet create --name myVnetA1 --resource-group myResourceGroupA --location eastus --address-prefix 10.0.0.0/16 --debug

azure.core.pipeline.policies._universal: Request URL: 'https://management.azure.com/subscriptions/414af076-009b-4282-9a0a-acf75bcb037e/resourceGroups/myResourceGroupA/providers/Microsoft.Network/virtualNetworks/myVnetA1?api-version=2020-07-01'
azure.core.pipeline.policies._universal: Request method: 'PUT'

azure.core.pipeline.policies._universal: Response status: 200
azure.core.pipeline.policies._universal: Response headers:
azure.core.pipeline.policies._universal:     'Azure-AsyncOperation': 'https://management.azure.com/subscriptions/414af076-009b-4282-9a0a-acf75bcb037e/providers/Microsoft.Network/locations/eastus/operations/c03bc43c-fe8f-48b7-9060-395483f80590?api-version=2020-07-01'

This is against the document Track asynchronous Azure operations - 200 response shouldn't have Azure-AsyncOperation header. Only 201 or 202 can.

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @vnetsuppgithub.

Issue Details
The REST spec says `200` is returned for "Update successful": https://github.com/Azure/azure-rest-api-specs/blob/494de57a286ed23d6f7ff7251b79db96dafa6f05/specification/network/resource-manager/Microsoft.Network/stable/2020-07-01/virtualNetwork.json#L191-L197 Public doc: https://docs.microsoft.com/en-us/rest/api/virtualnetwork/virtualnetworks/createorupdate#response When I am updating the `virtualNetworks`, I got `200` with `Azure-AsyncOperation` in the response header: ```sh > az network vnet create --name myVnetA1 --resource-group myResourceGroupA --location eastus --address-prefix 10.0.0.0/16 --debug azure.core.pipeline.policies._universal: Request URL: 'https://management.azure.com/subscriptions/414af076-009b-4282-9a0a-acf75bcb037e/resourceGroups/myResourceGroupA/providers/Microsoft.Network/virtualNetworks/myVnetA1?api-version=2020-07-01' azure.core.pipeline.policies._universal: Request method: 'PUT' azure.core.pipeline.policies._universal: Response status: 200 azure.core.pipeline.policies._universal: Response headers: azure.core.pipeline.policies._universal: 'Azure-AsyncOperation': 'https://management.azure.com/subscriptions/414af076-009b-4282-9a0a-acf75bcb037e/providers/Microsoft.Network/locations/eastus/operations/c03bc43c-fe8f-48b7-9060-395483f80590?api-version=2020-07-01' ``` This is against the document [Track asynchronous Azure operations](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/async-operations) - `200` response shouldn't have `Azure-AsyncOperation` header. Only `201` or `202` can.
Author: jiasli
Assignees: akning-ms
Labels: `Network - Virtual Network`, `Service Attention`, `needs-triage`
Milestone: -