Skip to content
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_version_set fails to update or craeate after 2.7.0 #6609

Closed
jonatasbaldin opened this issue Apr 24, 2020 · 3 comments · Fixed by #7071
Closed

azurerm_api_management_api_version_set fails to update or craeate after 2.7.0 #6609

jonatasbaldin opened this issue Apr 24, 2020 · 3 comments · Fixed by #7071

Comments

@jonatasbaldin
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

Terraform v0.12.23
+ provider.azurerm v2.7.0

Affected Resource(s)

  • azurerm_api_management_api_version_set

Terraform Configuration Files

resource "azurerm_api_management_api_version_set" "example" {
  name                = "example-apimapi"
  resource_group_name = var.resource_group_name
  api_management_name = var.apim_name
  display_name        = "ExampleAPIVersionSet"
  versioning_scheme   = "Segment"
}

resource "azurerm_api_management_api" "example" {
  name                = "example-api"
  resource_group_name = var.resource_group_name
  api_management_name = var.apim_name
  revision            = "1"
  display_name        = "Example API"
  path                = "example_me"
  protocols           = ["https"]
  service_url         = "https://conferenceapi.azurewebsites.net/"
  version             = "v1"
  version_set_id      = azurerm_api_management_api_version_set.example.id


  import {
    content_format = "swagger-link-json"
    content_value  = "http://conferenceapi.azurewebsites.net/?format=json"
  }
}

Debug Output

Will try to include later. This is a private Terraform configuration, there's probably sensitive information in the DEBUG.

Expected Behavior

After updating to 2.7.0 I expected APIM to keep working.

Actual Behavior

The azurerm_api_management_api_version_set fails to update with the following error:

Error: creating/updating API "example-api" / Revision "1" (API Management Service "apimgmt-rnd-ui" / Resource Group "rg-infra-rnd"):
apimanagement.APIClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ValidationError" Message="One or more fields contain incorrect values:"

Details=[{"code":"ValidationError","message":"Parsing error(s): An error occured while parsing the input. Message: Value /api-version-sets/example-apimapi doesn't match required format /apiVersionSets/{id}","target":"representation"}]

I tried to remove and create again, then got this error:

Error: making Read request for Api Version Set "" (Resource Group "rg-infra-rnd" / Api Management Service "apimgmt-rnd-ui"):
apimanagement.APIVersionSetClient#Get: Invalid input: autorest/validation: validation failed: parameter=versionSetID constraint=MinLength value=""
details: value length must be greater than or equal to 1

Steps to Reproduce

  1. terraform apply

References

This is probably related to #5769 and/or #6479.

@nzthiago
Copy link

@katbyte fyi

@mhennecke
Copy link

In the meantime, for anyone running into this issue, following workaround works for me:
version_set_id = replace(azurerm_api_management_api_version_set.api.id, "api-version-sets", "apiVersionSets")

jochenrichter pushed a commit to jochenrichter/terraform-provider-azurerm that referenced this issue May 22, 2020
tombuildsstuff pushed a commit that referenced this issue May 25, 2020
katbyte pushed a commit that referenced this issue May 25, 2020
…rce ID (#7071)

This PR is a continuation of the changes done by @jochenrichter in #7055 but adds a State Migration for migrating from the old -> new ID

Fixes #6609
pbrit pushed a commit to pbrit/terraform-provider-azurerm that referenced this issue May 31, 2020
…rce ID (hashicorp#7071)

This PR is a continuation of the changes done by @jochenrichter in hashicorp#7055 but adds a State Migration for migrating from the old -> new ID

Fixes hashicorp#6609
@ghost
Copy link

ghost commented Jun 25, 2020

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 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants