azurerm_app_service forces new resource when tags{} is modified - breaks import use case #359
Labels
bug
service/app-service
upstream/microsoft
Indicates that there's an upstream issue blocking this issue/PR
Milestone
Terraform Version
Terraform v0.10.6
plugin: terraform-provider-azurerm_v0.2.1_x4
Affected Resource(s)
azurerm_app_service
Terraform Configuration Files
Debug Output
Gist unnecessary
terraform plan
wants to destroy and recreate resource when modifying a tag.Panic Output
n/a
Expected Behavior
terraform plan
andterraform apply
should modify the tag in-place.Actual Behavior
terraform apply
destroys the app service and re-creates it, which means the application is down until re-deployed.Steps to Reproduce
create or import an app service including specifying 'tags'.
change/add/remove a tag
terraform plan
orterraform apply
Important Factoids
None.
References
Documentation DOES show that changing the tag will force a new resource, however, there is no obvious reason to do this. Changing the tag in the portal and in the .tf file, then doing a
terraform refresh
will work, UNLESS you imported the resource after creating it through the UI. In that case, there is a hidden tag that you cannot modify except through the API, and even having a tags{} section will force a new resource. This makes importing an existing resource impossible without a workaround that is non-obvious (manual surgery on the tfstate file to add the hidden tag or removing the hidden tag from Azure by other methods). Since importing is most commonly used for resources created outside of Terraform, this use case makes the azurerm_app_service not behave as expected when tags{} are specified.The text was updated successfully, but these errors were encountered: