hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.61k stars 4.65k forks source link

data_factory_dataset_delimited_text: schema_column deploys to incorrect json block in Azure ADF, no schema is deployed via Terraform #12585

Open philthynz opened 3 years ago

philthynz commented 3 years ago

Community Note

Terraform (and AzureRM Provider) Version

Terraform v1.0.1
on windows_amd64
+ provider registry.terraform.io/hashicorp/azuread v1.5.1
+ provider registry.terraform.io/hashicorp/azurerm v2.67.0
+ provider registry.terraform.io/hashicorp/http v2.1.0
+ provider registry.terraform.io/hashicorp/null v3.1.0
+ provider registry.terraform.io/hashicorp/random v3.1.0
+ provider registry.terraform.io/hashicorp/time v0.7.2

Affected Resource(s)

Terraform Configuration Files

resource "azurerm_data_factory_dataset_delimited_text" "example" {
  name                = "dataset1"
  description         = "files for dataset"
  resource_group_name = module.resource_group.name
  data_factory_name   = module.adf.name
  linked_service_name = local.resource_name
  column_delimiter    = ","
  row_delimiter       = "\n"
  encoding            = "UTF-8"
  quote_character     = "\""
  escape_character    = "\\"
  first_row_as_header = true
  null_value          = "NULL"

  azure_blob_storage_location {
    container = "containername"
    path = "Folder1"
    filename = "data.csv"
  }

  schema_column {
    name = "Survey"
    type = "String"
  }
}

Debug Output

No errors

Panic Output

No errors

Expected Behaviour

Schema block is placed under the json "schema" block in Azure ADF.

        "schema": [
            {
                "name": "Survey",
                "type": "String"
            }
         ],
        "structure": []

Actual Behavior

Schema block is placed under the incorrect json block "structure" in Azure ADF

        "schema": [],
        "structure": [
            {
                "name": "Survey",
                "type": "String"
            }
        ]

Steps to Reproduce

  1. terraform apply

References

This Schema code block was exported from Azure Data factory, showing it's under the incorrect json block. No schema is deployed via this terraform code block.

hahvale commented 2 years ago

I have the same issue with azurerm v3.6.0.