Hi,
Using terraform modules to create Azure - MySql DB flexible server. Here below I’m mentioning the resources which created along with server:
1.Delegated subnet
2.Mysql database
3. storage
4.NSG
I’m using the existing network resource like,
Vnet
Private DNS Zone
Vnet link between DNS & Vnet - Not creating along with server
Able to provision every resources without any interruptions via terraform commands (only apply)& Json file. while creating I could come to know that the subnet establishing a SAL (Service Association Link) implicitly.
When try to delete the resources via terraform commands (only apply) & Json file, getting a subnet error saying that,
Error message:││ Subnet Name: “subnet_name”): network.SubnetsClient#Delete: Failure sending request: StatusCode=400 – Original Error: Code=“InUseSubnetCan
notBeDeleted” Message=“Subnet “subnet_name” is in use by /subscriptions/“subscription_id”/resourceGroups/mysql-rg/pro
viders/Microsoft.Network/virtualNetworks/example-vnet/subnets/“subnet_name”/serviceAssociationLinks/“link_id”-sal and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet.” Details=
│
privacy purpose, hided Subnet name, link_id & subscription details
I could able to delete all the Mysql server resource(Server, DB, Storage account, NSG) but not subnet due to SAL.
This issue occurs in postgresql flexible server as well. please provide a solution on this.
If any details required kindly reach out. Thanks!