Open
Description
I tried to create primary mysql flexible server and replica flexible server and they are created successfully. Then I tried to delete them in order but it failed and threw below error message while deleting subnet. Per the error message, seems the Service Association Link that is created by Service API at backend isn't deleted correctly so that the related subnet also cannot be deleted. Could you help take a look? Thanks.
Repro steps:
1. Create resource group
2. Create vnet
3. Create subnet
4. Create private dns zone
5. Link private dns zone to vnet
6. Create primary mysql flexible server
7. Create replica mysql flexible server
8. Delete replica mysql flexible server
9. Delete primary mysql flexible server
10. Delete link between private dns zone and vnet. In the meanwhile, delete subnet
11. At this time, API failed to delete subnet
Error message:
network.SubnetsClient#Delete: Failure sending request: StatusCode=400 -- Original Error: Code="InUseSubnetCannotBeDeleted" Message="Subnet acctest-subnettest01 is in use by /subscriptions/xx-xx-xx-xx-xx/resourceGroups/acctestRG-mysqlfs-test01/providers/Microsoft.Network/virtualNetworks/acctest-dbvn-test01/subnets/acctest-subnettest01/serviceAssociationLinks/acctest-subnettest01-service-association-link and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet." Details=[]