-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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_container_app_environment import not reading log_analytics_workspace_id from azure #20535
Comments
If I try and pass the workspace_id, that single guid, |
I unfortunately ran into the same issue importing a container app environment using the last 3.52.0 azurerm provider. |
I think I will hold off on using that approach as the container app resource still messed up my container apps as can be seen on the above screenshot. I've checked the realease notes for every release since then and I haven't seen a fix for these issues. Maybe it's an upstream dependency on the azure api? |
Yeah there's definitely something going on with the apply on this resource or something. I did the same thing as @mendoncaftw, just added some tags and did a plan, plan showed just tag updates, so I applied. Come back to look at some system logs a week later and lo and behold, that apply to just add some tags also decided to remove my log analytics id from the resource so now I'm missing a weeks worth of logs. I didn't import my CAE though, mine was TF-ed cradle to grave so not sure how that would've happened but a definite problem for us going forward. |
Also run into this issue. I wrote some import blocks, but the terraform plan always wanted to recreate the azurerm_container_app_environment. When I tried to copy the ID from azure portal into the tfstate like @itfranck wrote, I received this replacement:
Where the capitalization is wrong. |
A workaround
|
We also encountered this issue, manually setting the id in the tf state file resolves it but it doesn't seem right to have to do that |
Is there an existing issue for this?
Community Note
Terraform Version
1.3.8
AzureRM Provider Version
3.44.0
Affected Resource(s)/Data Source(s)
azurerm_container_app_environment
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Imports all the configuration from the resource and
terraform plan
does not detect any changes on the resource.Actual Behaviour
Following the successful import, when I run
terraform plan
it says it's going to recreate the resource because the log_analytics_workspace_id property has been set.Maybe it has to do with how the api exposes the log_analytics_workspace_id, since the az cli returns:
az containerapp env show -n containerappsenv-dev -g RG_DEV_fr
Is the go api returning the same info as the azure cli? Because it might be the transformation of the workspace id in the format of a resource id:
"/subscriptions/subscription-id/resourceGroups/RG_DEV_fr/providers/Microsoft.OperationalInsights/workspaces/workspacergdevfra2cf"
versus
with the format returned by the api:
"customerId": "9aca09af-89d1-4a86-82ad-be71f59fc219"
Steps to Reproduce
terraform import
terraform plan
Important Factoids
azure france central
References
No response
The text was updated successfully, but these errors were encountered: