Azure Data Lake Gen2 FileSystem creation error

Hi there,
I want to create a DataLake storage account and Container on this account using Terraform. Resource group and storage accounts are created successfully, but when TF deploys a “azure_storage_data_lake_gen2_filesystem”, it creates the filesystem for 7.5 minutes and then return an error:

"Error checking for existence of existing File System “containername” (Account “storageaccountname”): datalakestore.Client#GetProperties: Failure sending request: StatusCode=0 – Original Error: Head “”: authenticationrequired.

Code is pretty standard from TF examples:

resource "azurerm_storage_data_lake_gen2_filesystem" "this" {
 name = "containername"
 storage_account_id =

If I add az command call from TF code, it successfully creates a folder

provisioner "local-exec" {
 command = "az storage fs create --name containername --account-name ${local.storageAccountName} --auth-mode login"

Any ideas what could be the problem?

1 Like

I am actually stuck on the same error for a long time now. any progress yet please @artemtao?

I clarified this issue. The data lake storage gen2 is basically a normal general purpose v2 storage account with hierarchical namespace enabled so creating a storage account with hns set to true is all you need. Private endpoints can be created referring to the storage account as the connected account with the subresource dfs.