Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subnet previously used by deleted api management service cannot be deleted #2199

Closed
torresdal opened this issue Jul 9, 2018 · 4 comments
Closed
Assignees

Comments

@torresdal
Copy link

I'm currently implementing support for the API Mangement service in Terraform and ran into an issue where our integration tests fail when trying to delete a subnet previously used by a deleted API Management service. (ref: hashicorp/terraform-provider-azurerm#1516)

The actual error :

autorest/azure: Service returned an error. Status=400 Code="InUseSubnetCannotBeDeleted" Message="Subnet testsubnet1 is in use by /subscriptions/0967fd64-a807-47e1-bf05-0e55e24a68d5/providers/Microsoft.ApiManagement/service?vnetResourceGuid=4b40d13c-b439-4ea8-b898-844b4413c252&subnet=testsubnet1&api-version=2016-07-07 and cannot be deleted." Details=[]

Note: We can eventually delete the subnet, but usually it takes close to an hour before we can do so.

Taking into account that it takes from 30-50 minutes to create the API Management service in Azure and only seconds to delete it, it would be safe to assume that the actual underlying Azure resources are still being deleted behind the scenes, after ServiceClient.Delete() has succeeded. It would also be natural to assume that these resources are the ones preventing the subnet to be deleted.

What I would expect is that ServiceClient.Delete() would return a azure.Future (instead of autorest.Response) and where WaitForCompletion() would succeed when all underlaying API Management resources are properly deleted, or at least detached from resources like subnet.

@jhendrixMSFT
Copy link
Member

@promoisha is this something you can help with?

@torresdal
Copy link
Author

I was hoping to finish the implementation for API Management in Terraform. Any more infomation on this issue?

@torresdal
Copy link
Author

@jhendrixMSFT @promoisha Any update on this?

@jhendrixMSFT
Copy link
Member

This will be tracked in Azure/azure-rest-api-specs#4409.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants