You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The version set and first API (v1) is created fine, the second version (v2) fails with this error:
Error: Error creating/updating API Management API "sct001-test-dpo2-v2" (Resource Group "CLIENT"): apimanagement.APIClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="ValidationError" Message="One or more fields contain incorrect values:" Details=[{"code":"ValidationError","message":"Cannot create API 'sct001-test-dpo2-v2' with the same Path 'sct001/test/dpo2' as API 'sct001-test-dpo2-v1' unless it's a part of the same version set","target":"path"}]
If I create the APIs without importing a swagger file then it works as expected and I get two empty versioned APIs
Steps to Reproduce
Create two swagger files for versions of the API
Create a version set
Create two apis, using the version set and swagger files
Terraform apply
Important Factoids
References
#0000
The text was updated successfully, but these errors were encountered:
Having looked at the code I think there problem is down to the way API's are being created when importing the content from a file. It looks like the provider first creates the API using the swagger file, with no version ID attached, and then applies the version ID and version_set to it. This works fine for the first API in a version set, but when you try and create a second using the same path it fails, because it is first creating an un-versioned API with the intent of adding the version after, which is not allowed as the first version already exists.
For this to work properly the version needs to be applied at the time of creation.
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!
ghost
locked and limited conversation to collaborators
Mar 29, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Community Note
Terraform (and AzureRM Provider) Version
Terraform: v0.12.13
Azure RM provider : v1.37.0
Affected Resource(s)
azurerm_api_management_api
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
An API with two versions should be created
Actual Behavior
The version set and first API (v1) is created fine, the second version (v2) fails with this error:
If I create the APIs without importing a swagger file then it works as expected and I get two empty versioned APIs
Steps to Reproduce
Important Factoids
References
The text was updated successfully, but these errors were encountered: