hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.58k stars 4.62k forks source link

`azurerm_api_management_api` wsdl_selector is required by the provider but not by the API #22489

Closed tiwood closed 1 year ago

tiwood commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.4.5

AzureRM Provider Version

3.64.0

Affected Resource(s)/Data Source(s)

azurerm_api_management_api

Terraform Configuration Files

resource "azurerm_api_management_api" "main" {
  name                = var.name
  display_name        = var.displayName
  resource_group_name = data.azurerm_api_management.main.resource_group_name
  api_management_name = data.azurerm_api_management.main.name

  protocols             = ["https"]
  path                  = "/foo"
  subscription_required = true

  import {
    content_format = "wsdl"
    content_value  = file(local.api_schema_path)
  }

  subscription_key_parameter_names {
    header = "x-api-key"
    query  = "api-version"
  }
}

Debug Output/Panic Output

│ Error: `wsdl_selector` is required when content format is `wsdl` in API Management API "foo"
│ 
│   with module.foo.azurerm_api_management_api.main,
│   on ../main.tf line 34, in resource "azurerm_api_management_api" "main":
│   34: resource "azurerm_api_management_api" "main" {
│

Expected Behaviour

The spec gets imported without errors.

Actual Behaviour

No response

Steps to Reproduce

No response

Important Factoids

I was able to create the API without provide a selector using the portal. While inspecting the traffic, I confirmed no wsdl selector was sent in the PUT request.

Successful raw request (notice no wsdl selector is sent):

PUT /subscriptions/ddd/ddd/ddd?import=true&api-version=2022-09-01-preview HTTP/1.1
Host: management.azure.com
Connection: keep-alive
Content-Length: 39777
Cache-Control: max-age=0
sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Brave";v="114"
sec-ch-ua-mobile: ?0
Authorization: Bearer xxx
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Content-Type: application/json
Accept: application/json, text/plain, */*
If-Match: *
sec-ch-ua-platform: "macOS"
Sec-GPC: 1
Accept-Language: en-GB,en;q=0.5
Origin: https://apimanagement.hosting.portal.azure.net
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: https://apimanagement.hosting.portal.azure.net/
Accept-Encoding: gzip, deflate, br

{"properties":{"format":"wsdl","value":"someXMLstuff","apiType":"soap"}}

References

No response

github-actions[bot] commented 5 months ago

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.