I cannot remove resource group because the network interface blocks the deletion of the network security group and the public ip address. The error indicates that the nic is associated with the NSG and the IP address, but when I try to open the NIC, the resource is not found.
How can I delete my resource group and all the resources in it?
ERROR:
{"Error":{"Code":"ResourceGroupDeletionBlocked","Target":null,"Message":"Deletion of resource group '' failed as resources with identifiers 'Microsoft.Network/networkSecurityGroups/main_vmNSG,Microsoft.Network/publicIPAddresses/main_vmPublicIP,Microsoft.Network/virtualNetworks/main_vmVNET' could not be deleted. The provisioning state of the resource group will be rolled back. The tracking Id is '4925b5cb-c51d-4366-a578-e9f760ee3583'. Please check audit logs for more details.","Details":[{"Code":null,"Target":"/subscriptions//resourceGroups//providers/Microsoft.Network/networkSecurityGroups/main_vmNSG","Message":"{\"error\":{\"code\":\"InUseNetworkSecurityGroupCannotBeDeleted\",\"message\":\"Network security group /subscriptions//resourceGroups//providers/Microsoft.Network/networkSecurityGroups/main_vmNSG cannot be deleted because it is in use by the following resources: /subscriptions//resourceGroups//providers/Microsoft.Network/networkInterfaces/main_vmVMNic. In order to delete the Network security group, remove the association with the resource(s). To learn how to do this, see aka.ms/deletensg.\",\"details\":[]}}","Details":null,"AdditionalInfo":null},{"Code":null,"Target":"/subscriptions//resourceGroups//providers/Microsoft.Network/publicIPAddresses/main_vmPublicIP","Message":"{\"error\":{\"code\":\"PublicIPAddressCannotBeDeleted\",\"message\":\"Public IP address /subscriptions//resourceGroups//providers/Microsoft.Network/publicIPAddresses/main_vmPublicIP can not be deleted since it is still allocated to resource /subscriptions//resourceGroups//providers/Microsoft.Network/networkInterfaces/main_vmVMNic/ipConfigurations/ipconfigmain_vm. In order to delete the public IP, disassociate/detach the Public IP address from the resource. To learn how to do this, see aka.ms/deletepublicip.\",\"details\":[]}}","Details":null,"AdditionalInfo":null},{"Code":null,"Target":"/subscriptions//resourceGroups//providers/Microsoft.Network/virtualNetworks/main_vmVNET","Message":"{\"error\":{\"code\":\"InUseSubnetCannotBeDeleted\",\"message\":\"Subnet main_vmSubnet is in use by /subscriptions//resourceGroups/***/providers/Microsoft.Network/networkInterfaces/main_vmVMNic/ipConfigurations/ipconfigmain_vm and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet.\",\"details\":[]}}","Details":null,"AdditionalInfo":null}],"AdditionalInfo":null}}