-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Cannot destroy Azure Firewall #14966
Comments
hey @TamasSzerb Thanks for opening this issue - apologies for the confusion on our part here, looking into #14866 I read that as FrontDoor and not Firewall 🤦 Taking a look into this one this appears to be a similar issue in the Azure SDK for Go where the Content-Type field isn't being sent during the deletion of this resource - https://github.com/Azure/azure-sdk-for-go/blob/ff3a653623e72d5d9a54bdb89cbd1b5646623974/services/network/mgmt/2021-05-01/network/azurefirewalls.go#L154-L173 Comparing the current Swagger version that that's generated from and an older version these appear comparable - so my guess is this is actually a breaking change to the API behaviour that's rolling out, where the Content-Type was previously implied, but now isn't. @jhendrixMSFT @JeffreyRichter heads up I think there's a breaking API change here which'll affects other SDK clients - although it's strange this isn't outputting a Json Content Type in the Go SDK here too, since the Swagger looks fine? Thanks! |
Sorry for the delay. The SDK doesn't set a content type as there is no body being sent as part of the request. Did this used to work in the past? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The firewall client is using azure go sdk 2021-05-01. There is a DeletePreparer function, which configures request using autorest, but does not include What's weird for me: in the same azurefirewalls.go, the content type is set for request when creating/updating Azure Firewall. For me it looks like the azure-go-sdk library needs a fix - it is a one-line fix, not sure about release process here - and how to bump versions in this terraform provider afterwards. P.S. I am here, because we have the same issue. |
Can anybody comment if this used to work though? We've never added the Content-Type header in the past for APIs that don't send a body in the request. If the service team changed the behavior here it would be great to know so I can follow up on that too. |
@jhendrixMSFT I was developing/deploying Firewall using terraform in January this year and did not have this problem. I can not say exactly when it happened, but it looks like a recent problem (i.e. we encountered it first time last week~). |
Likewise, I've been adding/removing Azure firewalls with Terraform without incident over the last few months. Not tried in the last week or so though. |
@jhendrixMSFT I have been deploying and destroying Azure Firewall resources using Terraform (with |
Same here, it worked ever since the resource |
I can also confirm that this was recent, and I opened #14866 when I had first encountered this. |
I also have the same issue and got stuck here. Is there any update on this? Is that more of a problem that Microsoft or Go has to fix or something to do with azurerm? |
@jhendrixMSFT We developed a module middle of last year that includes a firewall. The module updates the Azurerm Version automatically every week and runs tests. This issue just appeared this week when the test pipeline failed but we had the issue in another module 2 weeks ago. I'm trying to locate right now what resource caused it. Edit: |
Same on our end for CAF TF module we can more and more consisently repro in regions: https://github.com/aztfmod/terraform-azurerm-caf/runs/5051813780?check_suite_focus=true |
Bump... just experienced this consistently in terraform 1.1.5. Is there an update on a fix? |
Same problem here. Does anyone solved the issue? |
As a workaround you can invoke |
This is happening to us as well, our terraform modules were working just fine and this started to happen very recently. |
Faced the same issue of "Error deleting Azure Firewall" today. This is quite scary since we use versions to avoid exactly this kind of scenario. |
@jhendrixMSFT As @earthquakesan has indicated that the |
@magodo whilst this is being fixed within the Azure SDK/API's, would you mind updating the Delete call to manually set this header for the moment? We've done this in a few other places by lifting the Azure SDK method into an |
This functionality has been released in v2.96.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.15.1
on linux_amd64
Affected Resource(s)
azurerm_firewall
Terraform Configuration Files
Debug Output
Terraform has been successfully initialized!
Error: deleting Azure Firewall Firewall: (Azure Firewall Name "[redacted]" / Resource Group "[redacted]") : network.AzureFirewallsClient#Delete: Failure sending request: StatusCode=415 -- Original Error: Code="UnsupportedMediaType" Message="The content media type '' is not supported. Only 'application/json' is supported."
Panic Output
Expected Behaviour
Azure Firewall resource should be successfully destroyed.
Actual Behaviour
Terraform destroy failed.
Steps to Reproduce
terraform destroy
Important Factoids
References
The text was updated successfully, but these errors were encountered: