Azure / Azure/azure-rest-api-specs
Deleting Azure Network Manager right after deleting ANM Connection resource will ruin the subscription
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
## Swagger:
https://github.com/Azure/azure-rest-api-specs/blob/85fb4ac6f8bfefd179e6c2632976a154b5c9ff04/specification/network/resource-manager/Microsoft.Network/stable/2022-07-01/networkManagerScopeConnection.json#L128
https://github.com/Azure/azure-rest-api-specs/blob/85fb4ac6f8bfefd179e6c2632976a154b5c9ff04/specification/network/resource-manager/Microsoft.Network/stable/2022-07-01/networkManagerConnection.json#L122
https://github.com/Azure/azure-rest-api-specs/blob/85fb4ac6f8bfefd179e6c2632976a154b5c9ff04/specification/network/resource-manager/Microsoft.Network/stable/2022-07-01/networkManagerConnection.json#L275
https://github.com/Azure/azure-rest-api-specs/blob/85fb4ac6f8bfefd179e6c2632976a154b5c9ff04/specification/network/resource-manager/Microsoft.Network/stable/2022-07-01/networkManager.json#L125
## Reproduce Step:
1. Create the NetworkManager and ScopeConnection or SubscriptionNetworkManagerConnections or ManagementGroupNetworkManagerConnections resource.
2. Call the `ScopeConnections_Delete`, `SubscriptionNetworkManagerConnections_Delete` or `NetworkManagers_Delete`, and then immediately (within one sec) calling the `NetworkManagers_Delete` method.
3. **Cannot create new Network Manager same in test subscription any more**. Creating a new Network Manager using the same subscription as [scope](https://github.com/Azure/azure-rest-api-specs/blob/85fb4ac6f8bfefd179e6c2632976a154b5c9ff04/specification/network/resource-manager/Microsoft.Network/stable/2022-07-01/networkManager.json#L473) will fail and returns error like: `"Cannot have two Network Managers applied to the same object overlapping scope accesses. Scope id: /subscriptions/xxx. Network Manager Id: /subscriptions/xxx/resourceGroups/wt-media-resources/providers/Microsoft.Network/networkManagers/wtest. Overlapping accesses: SecurityAdmin"`, but step2 has successfully deleted the ANM, and there should be no ANM covering the subscription.
Contributor guide
Research direction
Start with the four linked 2022-07-01 Network Manager specification files, especially the ScopeConnections_Delete, SubscriptionNetworkManagerConnections_Delete, and NetworkManagers_Delete operations. Reproduce the deletion sequence in a test subscription and compare the resulting behavior with the documented scope rules. Done means the immediate deletion sequence no longer prevents creating another Network Manager for the subscription, with the affected API behavior verified.
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
- 35/100