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_app_configuration_feature and azurerm_app_configuration_key showing incorrect changes required #22088

Closed
1 task done
matt-funda opened this issue Jun 8, 2023 · 3 comments

Comments

@matt-funda
Copy link

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.4.6

AzureRM Provider Version

3.59.0

Affected Resource(s)/Data Source(s)

azurerm_app_configuration_feature / azurerm_app_configuration_key

Terraform Configuration Files

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "= 3.59.0"
    }
  }
  required_version = ">= 1.3.0"
}

provider "azurerm" {
  features {}
}

data "azurerm_client_config" "current" {
}

resource "azurerm_resource_group" "main" {
  name = "rg-terraform-appconf-test"
  location = "West Europe"
}

resource "azurerm_app_configuration" "appconf_test_one" {
  name                = "appconf-terraform-bug-test-one"
  resource_group_name = azurerm_resource_group.main.name
  location            = azurerm_resource_group.main.location
  sku                 = "standard"
}

resource "azurerm_app_configuration" "appconf_test_two" {
  name                = "appconf-terraform-bug-test-two"
  resource_group_name = azurerm_resource_group.main.name
  location            = azurerm_resource_group.main.location
  sku                 = "standard"
}

resource "azurerm_role_assignment" "role_assignment_one" {
  scope                = azurerm_app_configuration.appconf_test_one.id
  role_definition_name = "App Configuration Data Owner"
  principal_id         = data.azurerm_client_config.current.object_id
}

resource "azurerm_role_assignment" "role_assignment_two" {
  scope                = azurerm_app_configuration.appconf_test_two.id
  role_definition_name = "App Configuration Data Owner"
  principal_id         = data.azurerm_client_config.current.object_id
}

resource "azurerm_app_configuration_key" "config" {
  configuration_store_id = azurerm_app_configuration.appconf_test_two.id
  key                    = "config"
  value                  = "config"
}

Debug Output/Panic Output

https://gist.github.com/matt-funda/f32b53d14a2e0821c45d1a236c0a86df

Expected Behaviour

After the second run terraform should report no changes required.

Actual Behaviour

After the second run the azurerm_app_configuration_key.config resource reports as needing to be recreated something like:

-/+ resource "azurerm_app_configuration_key" "config" {
      ~ configuration_store_id = "/subscriptions/075254db-75bd-4d17-b2a8-9fa8cdff9f65/resourceGroups/rg-appconf-test/providers/Microsoft.AppConfiguration/configurationStores/appconf-before-terraform" -> "/subscriptions/075254db-75bd-4d17-b2a8-9fa8cdff9f65/resourceGroups/rg-terraform-appconf-test/providers/Microsoft.AppConfiguration/configurationStores/appconf-terraform-bug-test-two" # forces replacement
      + content_type           = (known after apply)
      ~ etag                   = "W3G8hFJ9DIDn04hCSS0d2QU929D8utjHLEfX4i6goCE" -> (known after apply)
      ~ id                     = "https://appconf-terraform-bug-test-two.azconfig.io/kv/config?label=" -> (known after apply)
      - tags                   = {} -> null
        # (4 unchanged attributes hidden)
    }

Steps to Reproduce

  1. run terraform apply
  2. run either terraform apply or terraform plan again and see the error

Important Factoids

No response

References

I think this bug may have been introduced in #21750 but I am not sure exactly.

@teowa
Copy link
Contributor

teowa commented Jun 12, 2023

Hi @matt-funda , this is duplicate with #22061, and is resolved in PR #22072.
Thanks.

@matt-funda
Copy link
Author

Thanks @teowa! I saw that issue but didn't realise it was the same.

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 May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants