-
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
API Management (azurerm_api_management_api) support for openapi v3 content_format #3203
Comments
hey @mhennecke Thanks for opening this issue :) Taking a look into this it appears this requires an upgrade to the version of the Azure API we're using - we've got an upstream issue open requesting that here (which I've just requested an update for), but once that becomes available in the Azure SDK for Go (which is generated from that repo) we can look to add support for this 👍 Thanks! |
👋 The upstream issue's been fixed: Azure/azure-rest-api-specs#4409 - once the SDK's been updated #3335 we should be able to go to the new version of the API Management API - at which point it should be possible to add support for this Thanks! |
hey @tombuildsstuff, Any plans on this? :) |
Hei. Im intressed in this feature. Im working for Norway welfare and is in need for this, as we are exposing apis with the use of Azure Api-management. I would like to build the infrastructure with terraform. Any updates on the upgrade of the version of the Azure API? please hit me back thanks |
@ybelMekk @AndiA92 unfortunately we're still blocked on Azure/azure-rest-api-specs#6372 Once the Swagger's been fixed / the new API is available we should be able to add support for this - but unfortunately there's not a lot we can do until that's resolved. Thanks! |
@tombuildsstuff Hi Tom, is this issue blocking importing an OpenAPI specification using Terraform? |
@molinch yep - we're still waiting on the API Team to publish a Swagger document (which in turn generates a Go SDK for us to use) for the new API version |
Any updates on this or possibly a timeframe? |
Latest is: |
Just for information. I've forked the provider on my side, and I've managed to used openapi3 json and yaml.
For reference, here is the list Then you can You will able to import it like provider "azurerm" {
version = "=1.42.0"
}
provider "custom" {
} and then use it just for your resource like resource "azurerm_api_management_api" "foobar" {
provider = custom
name = "foobar"
import {
content_format = "openapi"
content_value = file("${path.module}/api-schema/openapi_openapi.yml")
}
} I hope it will help some people 👍 PS. The fork is on an internal gitlab server, so I can't directly share the repo... |
@tombuildsstuff the Azure go sdk has been updated, do you have a timeline on when the Provider will be updated? Just wanting to know if we should pursue the steps @PPACI outlined above or wait for the official fix. |
It has now been updated, released in 39.1.0 of the azure sdk for go Azure/azure-sdk-for-go#7317 |
This comment has been minimized.
This comment has been minimized.
When I set content_format as "swagger-link-json" and try to import an openapi v3 spec file, I get the following error: StatusCode=404 -- Original Error: autorest/azure: error response cannot be parsed: "" error: EOF Is there a workaround to this? |
I am also seeing "The Swagger version specified is unknown" when trying to upload an open api v3 document, until the openapi-link content_format is supported we will continue to use V2 swagger |
Is this one closed any day soon? 💃 |
@tombuildsstuff , Azure API stopped support on exporting Swagger-json format from the portal. Which means only way to update the existing API's in the APIM is through openAPI format from Terrafrom. This is now high priority. |
@tombuildsstuff There were a number of updates recently merged into the https://github.com/Azure/azure-rest-api-specs repo, and it looks like the Go SDK has been updated as well based on the last comment on the issue that was marked as blocking this one: Azure/azure-rest-api-specs#4409 |
I'd began work on the addition of the OAS v3 content-formats, but realized that this is a much larger undertaking than originally expected. The current set of API Management related azurerm code uses the 2018-01-01 version of APIM, and the OASv3 content-formats were added in version 2019-01-01. The azurerm provider now uses version 41.0.0 of the Azure SDK for Go, which added support for APIM versions 2018-06-01-preview, 2019-01-01, and 2019-12-01-preview, so the addition of the OASv3 content-formats is indeed possible. In order to make the change to allow the new content-formats on the API resource, however, the entire azurerm codebase for API Management needs to be updated to utilize 2019-01-01. As soon as the version is updated, it breaks clients and other resources downstream. The upgrade to the new version of APIM cannot be limited to the API resource type only. Even if it was possible to limit the changes to the API resource without causing other errors, I’m not sure that the Terraform team would accept a PR that causes the set of API Management resources to use multiple versions and be out of sync with each other. It will all need to be updated simultaneously. |
@lucashuet93 - i merged in a PR to upgrade to 2019-12-01 a couple days ago so this should be unblocked now 🙂 |
This has been merged with #6618 and should make it into v2.8.0 of the provider |
This has been released in version 2.8.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.8.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! |
Community Note
Description
The azurerm_api_management_api is missing support for OpenAPI v3 JSON and YAML imports in
provider version v1.24.0. Please add "openapi", "openapi+json" and "openapi-link" to the allowed content formats.
New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: