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

updating azurerm_app_configuration_feature fails with error when not using labels. #19856

Closed
1 task done
fgroen opened this issue Jan 4, 2023 · 3 comments · Fixed by #19900
Closed
1 task done

updating azurerm_app_configuration_feature fails with error when not using labels. #19856

fgroen opened this issue Jan 4, 2023 · 3 comments · Fixed by #19900
Labels

Comments

@fgroen
Copy link

fgroen commented Jan 4, 2023

Is there an existing issue for this?

  • I have searched the existing issues

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 Version

1.3.5

AzureRM Provider Version

3.37.0

Affected Resource(s)/Data Source(s)

azurerm_app_configuration_feature

Terraform Configuration Files

data "azurerm_client_config" "current" {}

resource "azurerm_role_assignment" "appconf_dataowner" {
  scope                = var.resource_group_id
  role_definition_name = "App Configuration Data Owner"
  principal_id         = data.azurerm_client_config.current.object_id
}

resource "azurerm_app_configuration" "appconfig" {
  name                = "appconf-fred"
  resource_group_name = var.resource_group_name
  location            = var.resource_group_location
  sku                 = "standard"
  tags                = var.tags
}

resource "azurerm_app_configuration_feature" "feature_toggle" {
  configuration_store_id = azurerm_app_configuration.appconfig.id
  name                   = "test"
  description            = "My feature"
  enabled                = true
}


To reproduce the error, change the feature toggle into something like:

resource "azurerm_app_configuration_feature" "feature_toggle" {
  configuration_store_id = azurerm_app_configuration.appconfig.id
  name                   = "test"
  description            = "My feature"
  enabled                = false
}

Debug Output/Panic Output

module.appconfiguration[0].azurerm_app_configuration_feature.feature_toggle: Modifying... [id=/subscriptions/XXXX/resourceGroups/rg-XXX/providers/Microsoft.AppConfiguration/configurationStores/appconf-fred/AppConfigurationFeature/test/Label/%00]
╷
│ Error: while unlocking key/label pair test/%00: appconfiguration.BaseClient#DeleteLock: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: error response cannot be parsed: {"" '\x00' '\x00'} error: EOF
│
│   with module.appconfiguration[0].azurerm_app_configuration_feature.feature_toggle,
│   on appconfig\main.tf line 55, in resource "azurerm_app_configuration_feature" "feature_toggle":
│   55: resource "azurerm_app_configuration_feature" "feature_toggle" {
│
│ while unlocking key/label pair test/%00: appconfiguration.BaseClient#DeleteLock: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: error response cannot be 
│ parsed: {"" '\x00' '\x00'} error: EOF

Expected Behaviour

A successful terraform apply, being able to change existing features without a label.

Actual Behaviour

When creating a feature without a label gives this output after apply (note the %00):

module.appconfiguration[0].azurerm_app_configuration_feature.feature_toggle: Creating...
module.appconfiguration[0].azurerm_app_configuration_feature.feature_toggle: Creation complete after 1s [id=/subscriptions/XXXX/resourceGroups/rg-XXX/providers/Microsoft.AppConfiguration/configurationStores/appconf-fred/AppConfigurationFeature/test/Label/%00]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

When trying to change that feature the plan with give this output:

Terraform will perform the following actions:

  # module.appconfiguration[0].azurerm_app_configuration_feature.feature_toggle will be updated in-place
  ~ resource "azurerm_app_configuration_feature" "feature_toggle" {
      ~ enabled                 = true -> false
        id                      = "/subscriptions/XXXX/resourceGroups/rg-XXX/providers/Microsoft.AppConfiguration/configurationStores/appconf-fred/AppConfigurationFeature/test/Label/%00"
        name                    = "test"
        tags                    = {}
        # (4 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

When running the apply we get the error described above.

When I provide a label, I can change the features.

Steps to Reproduce

  1. change the feature (toggle enable state for example)
  2. terraform apply (produces the error)
  3. now add a label to the feature, (re)create it and try to change it, this all works

Important Factoids

No response

References

Might be related to the changes done for #19437 ?

@fgroen fgroen added the bug label Jan 4, 2023
@github-actions github-actions bot removed the bug label Jan 4, 2023
@prahlad141992
Copy link

Also, unable to delete features flag with azurerm provider version 3.37.0
Plan: 0 to add, 0 to change, 1 to destroy.
module.aacFeature.azurerm_app_configuration_feature.aacFeature["Broker.CompanyUI"]: Destroying... [id=/subscriptions/XXXXXXXXXXXX/resourceGroups/XXXXX/providers/Microsoft.AppConfiguration/configurationStores/XXXXX/AppConfigurationFeature/XXXX/Label/%00]
module.aacFeature.azurerm_app_configuration_feature.aacFeature["feature1"]: Destruction complete after 0s

apply is success but it is not deleted features from app configuration stores

@fgroen
Copy link
Author

fgroen commented Jan 10, 2023

Thank you for the quick response !

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants