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

Deletion of azurerm_firewall failing due to "UnsupportedMediaType" #14866

Closed
j-chao opened this issue Jan 9, 2022 · 9 comments · Fixed by hashicorp/pandora#565
Closed

Deletion of azurerm_firewall failing due to "UnsupportedMediaType" #14866

j-chao opened this issue Jan 9, 2022 · 9 comments · Fixed by hashicorp/pandora#565

Comments

@j-chao
Copy link

j-chao commented Jan 9, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v1.1.3
on darwin_amd64

  • provider registry.terraform.io/hashicorp/azurerm v2.91.0

Affected Resource(s)

  • azurerm_firewall

Terraform Configuration Files

resource "azurerm_firewall_policy" "gateway" {
  name                = var.name
  resource_group_name = var.resource_group_name
  location            = var.location
  sku                 = "Standard"

  dns {
    proxy_enabled = true
  }

  depends_on = [var.firewall_depends_on]
}

resource "azurerm_firewall" "gateway" {
  name                = var.name
  location            = var.location
  resource_group_name = var.resource_group_name
  sku_name            = "AZFW_VNet"
  sku_tier            = "Standard"
  firewall_policy_id  = azurerm_firewall_policy.gateway.id
  zones               = ["1", "2", "3"]
  threat_intel_mode   = "Alert"

  ip_configuration {
    name                 = "configuration"
    subnet_id            = azurerm_subnet.firewall.id
    public_ip_address_id = azurerm_public_ip.firewall.id
  }

  depends_on = [var.firewall_depends_on, azurerm_firewall_policy.gateway]

  tags = var.tags
}

Debug Output

https://gist.github.com/j-chao/97e5a332209d3026befdb744c2d039d3

Panic Output

Expected Behaviour

Azure Firewall resource should be successfully destroyed.

Actual Behaviour

Terraform destroy failed.

Steps to Reproduce

  1. Create azure firewall resource with Terraform
  2. Attempt to destroy with terraform destroy ...

Important Factoids

References

@sinbai

This comment has been minimized.

@tombuildsstuff
Copy link
Contributor

@j-chao thanks for reporting this, this is an upstream issue we're looking into.

tombuildsstuff added a commit to hashicorp/pandora that referenced this issue Jan 10, 2022
The importer assumes that these are defaulted to JSON like the other operation types and so
won't output/override a content type if it's JSON.

Fixes #563
Fixes hashicorp/terraform-provider-azurerm#14866
@tombuildsstuff tombuildsstuff added this to the v2.92.0 milestone Jan 10, 2022
@j-chao
Copy link
Author

j-chao commented Jan 11, 2022

@tombuildsstuff just curious, what's the upstream issue?

@tombuildsstuff
Copy link
Contributor

@j-chao internal upstream, not upstream-upstream - sorry - we're missing a Content-Type when sending this request for some reason (which is a bug) but appears to be a breaking behavioural change in the API, since this has been fine historically

@tombuildsstuff
Copy link
Contributor

Fixed via #14927

@github-actions
Copy link

This functionality has been released in v2.92.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!

@TamasSzerb
Copy link

TamasSzerb commented Jan 14, 2022

I see still this issue:

Initializing provider plugins...
[...]

  • Installing hashicorp/azurerm v2.92.0...
  • Installed hashicorp/azurerm v2.92.0 (signed by HashiCorp)

[...]
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."

so re-opened in: #14966

@byteknacker
Copy link

I upgraded to azurerm version 2.94.0 and still have the same issue with not being able to delete Azure Firewall

@github-actions
Copy link

github-actions bot commented Mar 5, 2022

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.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants