the state file is fully managed by Terraform. Normally there is no need to manually interact with it. Storing it in a repo, in my opinion, is not the best way to do it:
- every change would result in a commit (pipeline run, manually chance).
- every Terraform run needs access to the latest state therefore branching would also bring some issues.
Furthermore, the state file contains secrets and therefore needs to be stored in a secure manner.
Using Artifacts or Pipeline caching might be an option but storing it in a Blob for me was the best option.