Search code examples
datasetterraformlocationazure-data-lake-gen2azure-data-factory

Blocks of type “azure_blob_fs_location” are not expected here


I am currently deploying Azure Data Factory IaC with Terraform and DevOps Pipelines. When trying to deploy a new Delimited Text Dataset, I run into the following error:

│ Error: Unsupported block type

│ on ds_test.tf line 7, in resource “azurerm_data_factory_dataset_delimited_text” “test_dataset”:
│ 7: azure_blob_fs_location {

│ Blocks of type “azure_blob_fs_location” are not expected here.

##[error]Bash exited with code ‘1’.

This is my .tf file:

  resource "azurerm_data_factory_dataset_delimited_text" "test_dataset" {
    name                = "test_dataset"
    resource_group_name = "test-rsg"
    data_factory_name   = "test-adf"
    linked_service_name = "AzureDataLakeStorage1"

    azure_blob_fs_location {
      file_system = "csv-dump-demo"
      path = ""
      filename = "personal_customer_data.csv"
    }

    column_delimiter    = ","
    row_delimiter       = "\r\n"
    encoding            = "UTF-8"
    quote_character     = "\""
    escape_character    = "\\"
    first_row_as_header = true
    null_value          = "NULL"
  }

The Terraform documentation for Delimited Text Dataset states, that exactly one of the following location blocks need to be defined, in order to make the Dataset work:

  • azure_blob_fs_location
  • azure_blob_storage_location
  • http_server_location

Why is Terraform plan telling me that it is a unsupported block type? Am I missing something?


Solution

  • Seems like the Terraform documentation is deprecated because when I removed the block and tried to deploy the Data Set again, Terraform apply gave me the following output:

    │ Error: One of http_server_location, azure_blob_storage_location must be specified to create a DataFactory Delimited Text Dataset

    After I tried it with the use of azure_blob_storage_location instead of azure_blob_fs_location it worked. Maybe there are only two location blocks available anymore and the documentation is not up to date.