Terraform — 404 — Storage Account Not Found When You are Creating it. Why?

Rafael Medeiros
2 min readNov 28, 2023

This is a quick post to help anyone that may face this issue in the future. Terraform (or Azure) is not as descriptive in their errors as they should be. One day you are trying to create a storage account using Terraform, then you receive the following error:

Why that happens? For me at least, I was trying to create a storage account with some network rules that associate 2 subnets:

Then I realized both of them were missing the service endpoint “storage”:

After enabling it on both subnets, I was able to create the resource:

This was a generic error that covered a simple misconfiguration. If you set network rules for your storage account internal only, you must set the service endpoints on both of them to make sure they are able to communicate with your resources within the VNET.

That’s it, Happy Terraforming!

--

--

Rafael Medeiros

DevOps Engineer | 3x Azure | CKA | Terraform Fanatic | Another IT Professional willing to help the community