-
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 - Cannot add a revision to an existing API #12720
Comments
Hi @Berbe , thanks for opening this issue.
|
If I try the following: resource "azurerm_api_management_api" "example_2" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
api_management_name = azurerm_api_management.example.name
revision = "2"
service_url = "https://example.org"
source_api_id = "${azurerm_api_management_api.example.id};rev=1"
import {
content_format = "openapi+json"
content_value = file("${path.module}/example.json")
}
} I end up with: Future#WaitForCompletion: the number of retries has been exceeded: StatusCode=400 -- Original Error: Code="ValidationError" Message="One or more fields contain incorrect values:" Details=[{"code":"ValidationError","message":"Cannot create API 'example' with the same Path '' as API '***' unless it's a part of the same version set","target":"path"}
If I try: resource "azurerm_api_management_api" "example_2" {
name = "example_2"
resource_group_name = azurerm_resource_group.example.name
api_management_name = azurerm_api_management.example.name
revision = "2"
path = "example"
service_url = "https://example.org"
source_api_id = "${azurerm_api_management_api.example.id};rev=1"
import {
content_format = "openapi+json"
content_value = file("${path.module}/example.json")
}
} I end up with: Future#WaitForCompletion: the number of retries has been exceeded: StatusCode=400 -- Original Error: Code="ValidationError" Message="One or more fields contain incorrect values:" Details=[{"code":"ValidationError","message":"Cannot create API 'example_2' with the same Path 'example' as API 'example' unless it's a part of the same version set","target":"path"}] Of course, trying: resource "azurerm_api_management_api" "example_2" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
api_management_name = azurerm_api_management.example.name
revision = "2"
path = "example"
service_url = "https://example.org"
source_api_id = "${azurerm_api_management_api.example.id};rev=1"
import {
content_format = "openapi+json"
content_value = file("${path.module}/example.json")
}
} gives me the exact same error as the one provided in my original post: Future#WaitForCompletion: the number of retries has been exceeded: StatusCode=400 -- Original Error: Code="ValidationError" Message="Can't change property Name for non-current revision "
I am so confused... Trying to sum up all that has been tried and advised goes down to this: defining revisions all-at-once or separately produce different results. Going back to the original issue description, how come the same configuration applied to different contexts does not yield the same results? |
OK I think I got a lead. The problematic part was the resource "azurerm_api_management_api" "example_2" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
api_management_name = azurerm_api_management.example.name
revision = "2"
display_name = "example"
path = "example"
service_url = "https://example"
protocols = [
"https",
] Of course, it also works with the alternative definition format, resource "azurerm_api_management_api" "example_2" {
name = "example"
resource_group_name = azurerm_resource_group.example.name
api_management_name = azurerm_api_management.example.name
revision = "2"
path = "example"
service_url = "https://example.org"
source_api_id = "${azurerm_api_management_api.example.id};rev=1"
} The problem here is that, depending on whether you are creating the first revision of an API or not, the configuration you shall provide needs to be different. Is there a way to enhance |
This comment was marked as off-topic.
This comment was marked as off-topic.
Issue here is - revisions are supposed to help us add non-breaking changes to API's - like adding an operation to existing API. import { Here is the link to revisions from microsoft docs |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
What's the latest on this issue? I've reproduced the fact that revisions cannot be created (and updated to current). Are there plans to implement this? See example code |
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. |
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_api_management_api
Terraform Configuration Files
Based on an existing revision:
, create a new one:
Expected Behaviour
Revision
2
created alongside1
Actual Behaviour
Error: waiting on creating/updating API Management API "example" (Resource Group "example"): Future#WaitForCompletion: the number of retries has been exceeded: StatusCode=400 -- Original Error: Code="ValidationError" Message="Can't change property Name for non-current revision "
Steps to Reproduce
terraform apply
Additional information
If you try to create both at once, ie with:
, it works!
Revisions
1
&2
are created.The text was updated successfully, but these errors were encountered: