-
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
azurerm_api_management_api
wsdl_selector` is required when content_format = "wsdl"
#7076
Conversation
@@ -258,6 +258,12 @@ func resourceArmApiManagementApiCreateUpdate(d *schema.ResourceData, meta interf | |||
}, | |||
} | |||
wsdlSelectorVs := importV["wsdl_selector"].([]interface{}) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw you linked this to #6795, but I don't think that it's the cause for what I reported. It also affected swagger_json
formats.
I think it might have something to do with the whole if-statement that this code is in. The comment on line 241-242 is:
// If import is used, we need to send properties to Azure API in two operations.
// First we execute import and then updated the other props.
This was added when the underlying API was 2018-XX-XX. and I'm guessing that it was a workaround for a bug back then. I could not find anything in the REST API doc. that stated it has to be two requests.
Could it be an idea to do this in one request instead of two? Should not be very difficult to merge the request into one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tnicolaysen ,for issue #6795, I have tried to add wsdl_selector
in the code, and it's created with success. Do I miss anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can try to make a build from this branch and see if it solves my problem. But, it is still weird that the code performs the update in two steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested this branch with my setup.
- Creation of new OpenAPI APIs work now.
- Update of existing APIs work.
- Switch from swagger_json to openapi on an existing API worked.
- The primary/secondary key issue is confirmed fixed for me. (Not relevant to this PR).
I also got this expected error:
Error: `wsdl_selector` is required when content format is `wsdl` in API Management API "xxx-api"
on main.tf line 163, in resource "azurerm_api_management_api" "xxx":
163: resource "azurerm_api_management_api" "xxx" {
I didn't know that it was required. It's not required when importing a WSDL through Azure Portal. Maybe they just default to the first or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @tnicolaysen , yes, I have split the two problems in two PRs. Would you like to try if the below code works for you? And on portal, wsdl_selector
is required as the screenshot below.
resource "azurerm_api_management_api" "example" {
api_management_name = data.azurerm_api_management.apim.name
resource_group_name = data.azurerm_api_management.apim.resource_group_name
display_name = "Example API"
name = "example-api"
path = "example-api"
protocols = ["https"]
revision = "1"
service_url = "http://example.org"
soap_pass_through = true
// NOTICE: It partially works when not having an import, but it's just one of the issues
import {
content_format = "wsdl"
content_value = file("example.wsdl")
wsdl_selector {
service_name = "Calculator"
endpoint_name = "CalculatorHttpsSoap11Endpoint"
}
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance to get this one merged for the next release? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @yupwei68 - LGTM 👍
This has been released in version 2.14.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.14.0"
}
# ... other configuration ... |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Fix #6795