You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Hi,
The classic App Insights resource is being deprecated in February 2024. The recommendation is to move to a workspace-based app insights instead.
Doing this via Terraform forces the resource to be destroyed and recreated, which means we lose all of the data (logs) we already have. This is fine for non-prod environments but not prod.
It works fine via the portal, but importing the state is proving difficult.
Any suggestions? Has anyone else encountered the same issue?
Thanks,
Alex
Terraform Version
1.4.0
AzureRM Provider Version
3.47.0
Affected Resource(s)/Data Source(s)
azurerm_application_insights
Terraform Configuration Files
resource"azurerm_application_insights""apps" {
name="XXX"resource_group_name="XXX"location="XXX"application_type="Node.JS"tags={}
workspace_id="id of existing workspace"
}
# I have omitted our actual variable names etc as I assume you'll be able to fill these in.
Debug Output/Panic Output
There is no error output, it just behaves differently than expected (the Azure portal does not force a replacement or reset the data).
As this is small, I have pasted it here, rather than in a Gist:
+ workspace_id = "RESOURCE/URL/HERE"# forces replacement
Expected Behaviour
Connect to workspace without replacing the entire resource (like the Azure portal does).
Actual Behaviour
Recreates resource so we lose our logs / data from the app insights resource.
Steps to Reproduce
Try to connect an existing app insights resource to an existing workspace.
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered:
Hi @LordA98 thanks for raising the issue! The ForceNew was added by #15621 in order to resolve a service side mismatch as mentioned in #15576. I'll be looking into this further to see if we could have a better solution so that the update by Terraform.
As a temporary mitigation, you could try updating the workspace id on Azure Portal/CLI and do a terraform refresh to refresh the state file.
Thanks @LordA98, it looks like this may be resolved by #21029 so I am going to close this now. If there is still an issue however, feel free to re-open this. Thanks!
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.
Is there an existing issue for this?
Community Note
Hi,
The classic App Insights resource is being deprecated in February 2024. The recommendation is to move to a workspace-based app insights instead.
Doing this via Terraform forces the resource to be destroyed and recreated, which means we lose all of the data (logs) we already have. This is fine for non-prod environments but not prod.
It works fine via the portal, but importing the state is proving difficult.
Any suggestions? Has anyone else encountered the same issue?
Thanks,
Alex
Terraform Version
1.4.0
AzureRM Provider Version
3.47.0
Affected Resource(s)/Data Source(s)
azurerm_application_insights
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Connect to workspace without replacing the entire resource (like the Azure portal does).
Actual Behaviour
Recreates resource so we lose our logs / data from the app insights resource.
Steps to Reproduce
Try to connect an existing app insights resource to an existing workspace.
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: