When we run Terraform code to upgrade classic appinsight, it deletes existing diagnostics setting. Is it normal?

Xu, Sam 0 Reputation points
2024-02-19T00:07:22.2466667+00:00

When we run Terraform code to upgrade classic appinsight, it deletes existing diagnostics setting. Is it normal?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,510 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2024-02-19T00:07:22.25+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    No, it is not normal for Terraform code to delete existing diagnostics settings when upgrading a classic App Insights resource. Using an older version of the Terraform azurerm provider, such as version 3.12, may result in the deletion of the classic component before creating the replacement workspace-based Application Insights resource. To avoid this issue, make sure to use the latest version of the Terraform azurerm provider, version 3.89 or higher, which performs the proper migration steps by issuing the appropriate ARM call to upgrade the App Insights classic resource to a workspace-based resource while preserving all the old data and connection string/instrumentation key values.


    References:

    0 comments No comments

  2. SwathiDhanwada-MSFT 18,891 Reputation points
    2024-02-19T08:37:36.65+00:00

    @Xu, Sam As mentioned by Q & A Assist, if you're using Terraform to manage your Azure resources, it's important to use the latest version of the Terraform azurerm provider before attempting to upgrade your App Insights resource. Using an older version of the provider, such as version 3.12, may result in the deletion of the classic component before creating the replacement workspace-based Application Insights resource. It can cause the loss of previous data and require updating the configurations in your monitored apps with new connection string and instrumentation key values. To avoid this issue, make sure to use the latest version of the Terraform azurerm provider, version 3.89 or higher, which performs the proper migration steps by issuing the appropriate ARM call to upgrade the App Insights classic resource to a workspace-based resource while preserving all the old data and connection string/instrumentation key values. If you are still facing the issues, kindly provide us the terraform code that you are using so that we can test and provide you a resolution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.