Error when creating Storage Account "The storage account was not found"

Trying to create a new storage account, but receiving below error when running “Terraform apply” with version 3.10.0. Everything looks good when running “Terraform plan”, and there are no further details in the error message, so I don’t understand what’s wrong.

After running “Terraform apply”, the new storage account shows up in the state, but I have tried to remove it from the state with “terraform state rm”, and rerun apply, but with no success.

Error: retrieving Storage Account: (Name “xxxxxxxxxxxxxxxxxxxx” / Resource Group “Xxxxx-Xxxxxxxxx-Xxxxxx-Xxxxxxxxxx-Xxx”): storage.AccountsClient#GetProperties: Failure responding to request: StatusCode=404

Original Error: autorest/azure: Service returned an error. Status=404 Code=“StorageAccountNotFound” Message=“The storage account xxxxxxxxxxxxxxxxxxxx was not found.”


│ with module.storage.azurerm_storage_account.storage_account,
│ on …..\modules\storage\main.tf line 1, in resource “azurerm_storage_account” “storage_account”:│ 1: resource “azurerm_storage_account” “storage_account” {