Azure / Azure/azure-rest-api-specs
Network.VirtualHubClient cannot recreate virtual network connection with same name
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
I tried to `recreate` `virtual network connection` under virtual hub with `same name`. Although PUT API didn't return any error message but I found actually virtual network connection wasn't created after deployment. May I know is it expected?
call PUT API to create virtual network connection:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-vhub-200611150205848198/providers/Microsoft.Network/virtualHubs/acctest-VHUB-200611150205848198
{
"id": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-vhub-200611150205848198/providers/Microsoft.Network/virtualHubs/acctest-VHUB-200611150205848198",
"location": "westus",
"properties": {
"virtualWan": {
"id": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-vhub-200611150205848198/providers/Microsoft.Network/virtualWans/acctestvwan-200611150205848198"
},
"virtualNetworkConnections": [
{
"name": "acctestbasicvhubconn-200611150205848198",
"properties": {
"remoteVirtualNetwork": {
"id": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-vhub-200611150205848198/providers/Microsoft.Network/virtualNetworks/acctestvirtnet200611150205848198"
},
"allowHubToRemoteVnetTransit": false,
"allowRemoteVnetToUseHubVnetGateways": false,
"enableInternetSecurity": false
}
}
],
"addressPrefix": "10.0.2.0/24",
"routeTable": {
"routes": []
},
"provisioningState": "Succeeded",
"virtualHubRouteTableV2s": []
},
"tags": {}
}
```
call Get API to retrieve virtual network connection:
```
GET https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-vhub-200611150205848198/providers/Microsoft.Network/virtualHubs/acctest-VHUB-200611150205848198?api-version=2020-04-01
Response:
{
"name": "acctest-VHUB-200611150205848198",
"id": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-vhub-200611150205848198/providers/Microsoft.Network/virtualHubs/acctest-VHUB-200611150205848198",
"type": "Microsoft.Network/virtualHubs",
...
"properties": {
"provisioningState": "Succeeded",
"virtualNetworkConnections": [],
...
}
}
```
Repro steps:
1. Create virtual wan
2. Create virtual hub
3. Create virtual network connection with vnet connection name "vhubconn1"
4. You will find virtual network connection is created successfully after deployment
5. Delete this virtual network connection
6. Create virtual network connection with same vnet connection name "vhubconn1"
7. You will find virtual network connection isn't created after deployment
Contributor guide
Research direction
Reproduce the numbered steps against the virtual hub using the shown PUT request, then query it with the provided GET request and compare virtualNetworkConnections before and after deletion and recreation. Start with the Microsoft.Network virtualHubs API behavior for the 2020-04-01 request; the issue is done when recreating the same connection name either produces the connection in the GET response or the API clearly reports why it cannot.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100