Does Terraform plan command actually update the remote storage stage (Azure)?

Hi All,
I am using the Azure provider and terraform state is stored in an Azure blob container.
When running terraform plan from local workstation, I noticed that the the Modified time stamp of the Azure blob was getting updated even though the content of the Azure blob remained unchanged.

The examples below demonstrate how the Modified value on Azure portal changes with every execution of terraform plan command , while the Terraform source files remained unchanged. There was no terraform apply invoked at all.

Attempt 1
image


Attempt 2
image


Console output
This is the console output from the terraform plan command:


I was under the impression that terraform apply is the command which is actually responsible for updating the remote storage state

Please help me understand the underlying behaviour ?

Thank you,
Sau

I think, I may have found the answer to my question. When I used -lock=false argument, the Last Modified time stamp remained unchanged. This leads me to the conclusion that the change in Last Modified timestamp was caused by the locking attempt and probably not an actual change in the content of the plan.

Hi @sau001,

Before I read your answer, locking would’ve been my guess too, so I’m glad you were able to confirm that.

As you expected, terraform plan doesn’t create any new state snapshots in the remote system. Instead, Terraform saves the updated state as part of the plan file (assuming you chose to save one) and will wait until you run terraform apply to actually commit that updated state to the backend as a new snapshot.