I have created a azure terraform template to create a resource group and a vnet. I have run terraform plan and then apply . Created the environment. Now, for testing purpose some one has created a storage account through Azure portal in the same resource group. Ever since then, whenever I run terraform plan, its showing the resource group to be destroyed state.
Hence I renamed the resource group in the template, and ran the terraform plan. its showing new resource group creation along with the deletion of existing one.
I know this is happening , because terraform state file is having the information of the existing resource group. I am trying to remove the existing resource group from the state file by the below command
terraform state rm azurem_resource_group.rg <"subscription ID of the resource group">
I am getting the below error
Is there a way to remove the reference of existing resource in the state file ,so that it doesnt end up in deletion?
Many thanks in advance.