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_application_insights_workbook, cannot change workbook display_name #22113

Closed
1 task done
avishnyakov opened this issue Jun 11, 2023 · 1 comment · Fixed by #22148
Closed
1 task done

azurerm_application_insights_workbook, cannot change workbook display_name #22113

avishnyakov opened this issue Jun 11, 2023 · 1 comment · Fixed by #22148

Comments

@avishnyakov
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.3.7

AzureRM Provider Version

3.60.0

Affected Resource(s)/Data Source(s)

azurerm_application_insights_workbook

Terraform Configuration Files

terraform {
  required_version = "=1.3.7"

  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "=3.60.0"
    }
  }
}

provider "azurerm" {
  features {}
}

# example from documentation
# https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/application_insights_workbook
resource "azurerm_application_insights_workbook" "main" {
  name                = "96c11918-506e-4bae-974b-5f2dc44398f7"

  resource_group_name = local.resource_group_name
  location            = local.resource_group_location
  
  display_name        = "workbook1"
  
  data_json = jsonencode({
    "version" = "Notebook/1.0",
    "items" = [
      {
        "type" = 1,
        "content" = {
          "json" = "Test2022"
        },
        "name" = "text - 0"
      }
    ],
    "isLocked" = false,
    "fallbackResourceIds" = [
      "Azure Monitor"
    ]
  })

  tags = {
    ENV = "Test"
  }
}

Debug Output/Panic Output

n/a

Expected Behaviour

When display_name is changed, terraform apply should NOT fail.

Actual Behaviour

When display_name is changed, terraform apply FAILS.

Plan

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # azurerm_application_insights_workbook.main will be updated in-place
  ~ resource "azurerm_application_insights_workbook" "main" {
      ~ display_name        = "workbook1" -> "workbook1-chage"
        id                  = "REDACRED"
        name                = "96c11918-506e-4bae-974b-5f2dc44398f7"
        tags                = {
            "ENV" = "Test"
        }
        # (5 unchanged attributes hidden)
    }

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

Actual apply

│ Error: updating Workbook (Subscription: "REDACRED"
│ Resource Group Name: "REDACRED"
│ Workbook Name: "96c11918-506e-4bae-974b-5f2dc44398f7"): unexpected status 400 with error: BadRequest: Invalid hidden-title tag: 'workbook1', expecting hidden-title to be the same as properties.displayName: 'workbook1-chage'
│
│   with azurerm_application_insights_workbook.main,
│   on main.tf line 8, in resource "azurerm_application_insights_workbook" "main":
│    8: resource "azurerm_application_insights_workbook" "main" {
│
│ updating Workbook (Subscription: "REDACRED"
│ Resource Group Name: "REDACRED"
│ Workbook Name: "96c11918-506e-4bae-974b-5f2dc44398f7"): unexpected status 400 with error: BadRequest: Invalid hidden-title tag: 'workbook1', expecting hidden-title to be the same as properties.displayName:
│ 'workbook1-chage

Trying to change hidden-title tags via tags


...

   display_name        = "workbook1-chage"
...  
  tags = {
    ENV = "Test",
    "hidden-title" = "workbook1-chage",
  }

# plan fails
Error: a tag with the key `hidden-title` should not be used to set the display name. Please Use `display_name` instead

Changing display_name tag:

   display_name        = "workbook1-chage"
...  
  tags = {
    ENV = "Test",
    "display_name" = "workbook1-chage",
  }

Plan

  # azurerm_application_insights_workbook.main will be updated in-place
  ~ resource "azurerm_application_insights_workbook" "main" {
      ~ display_name        = "workbook1" -> "workbook1-chage"
        id                  = "...."
        name                = "96c11918-506e-4bae-974b-5f2dc44398f7"
      ~ tags                = {
          + "display_name" = "workbook1-chage"
            # (1 unchanged element hidden)
        }
        # (5 unchanged attributes hidden)
    }

Plan/Apply is OK

Changing both display name and tag together

  # azurerm_application_insights_workbook.main will be updated in-place
  ~ resource "azurerm_application_insights_workbook" "main" {
      ~ display_name        = "workbook1-chage" -> "workbook1-chage-2"
        id                  = "..."
        name                = "96c11918-506e-4bae-974b-5f2dc44398f7"
      ~ tags                = {
          ~ "display_name" = "workbook1-chage" -> "workbook1-chage-2"
            # (1 unchanged element hidden)
        }
        # (5 unchanged attributes hidden)
    }

Plan/Apply is OK

Steps to Reproduce

  • terraform apply
  • change display_name
  • terraform apply - this leads to apply failure, TF cannot change tags

Important Factoids

No response

References

No response

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
3 participants