Azurerm provider error unexpected new value: Root resource was present, but now absent

I am trying to create a storage account in my module in terraform but while creating the storage account terraform fails with this error.

module.testing.azurerm_storage_account.mlops_storage, provider
provider[""]" produced an
unexpected new value: Root resource was present, but now absent.

This is a bug in the provider, which should be reported in the provider’s own issue tracker.

The structure of my code is:
| |—modules (storage, kv etc.)
|-- main code (other resources + calling modules)

I am getting this error wile creating storage account from my module as well as when I try to create it independently.

Moreover, with azure GUI all works fine. Also, if I write only a sample code in new independent folder for creating a storage account in terraform then also it works but with my infrastructure code it fails with above error.

Can you please provide any solution to this?

I know it has been a while, but I’m curious if this was ever resolved. I received reports of similar behavior so I’d like to see if there is a solution out there.

This seemed to be an intermittent issue but I suspect it was more likely to be some bug either with terraform release or azure API version. I switched back to the older release and it worked for me.