Open tskrgulja opened 1 year ago
Any news?
How are you setting the default value (without omitting the row_delimiter) ? I tried several ways, but without any success.
Hi,
As a workaround I have created an extra azapi resource which sets Row delimiter to default value. I have wrapped it inside the module to make it easily reusable (but you can use code directly without wrapping if you want).
Something like this (your versions etc. might be different):
Module contents (set-default-row-delimiter/main.tf):
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
version = "=1.7.0"
}
}
}
variable "resource_id" {
type = string
}
resource "azapi_update_resource" "this" {
type = "Microsoft.DataFactory/factories/datasets@2018-06-01"
resource_id = var.resource_id
body = jsonencode({
"properties" : {
"typeProperties" : {
"rowDelimiter" : null
}
}
})
}
Example of usage (be sure to set correct path to the module):
resource "azurerm_data_factory_dataset_delimited_text" "example" {
name = "exampleDataset"
# rest of the parameters are omitted for brevity
}
module "set_default_row_delimiter_source" {
source = "../set-default-row-delimiter"
resource_id = azurerm_data_factory_dataset_delimited_text.example.id
}
Hope this helps :)
@tskrgulja - this looks incredibly helpful!
We've just resorted to manually setting the value manually after deployment as we couldn't come up with a reasonable workaround. This looks really positive.
Will test it in one of our future releases and see if it does the trick for us. Really appreciate you sharing this! Thank you!
Evan
I've just fired this up in a dev environment and it looks great. I've adjusted it to loop through my delimited datasets as we're creating a few as part of a loop that parses JSON files.
resource "azurerm_data_factory_dataset_delimited_text" "adfdsdt" {
for_each = { for x in local.adf_datasets : x.filename => x.config if x.config.properties.type == "DelimitedText" }
name = each.value.name
# Other properties removed
}
# Set the default row delimiter for each delimited dataset
module "set_default_row_delimiter" {
for_each = azurerm_data_factory_dataset_delimited_text.adfdsdt
source = "./set-default-row-delimiter"
resource_id = each.value.id
depends_on = [ azurerm_data_factory_dataset_delimited_text.adfdsdt ]
}
Great work @tskrgulja - appreciate it again!
Tks @tskrgulja for sharing your workaround.
Is there an existing issue for this?
Community Note
Terraform Version
1.5.2
AzureRM Provider Version
3.64.0
Affected Resource(s)/Data Source(s)
azurerm_data_factory_dataset_delimited_text
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Please see issue #13545. It is Resolved but row_delimiter property has not been fixed.
Actual Behaviour
Please see issue #13545. It is Resolved but row_delimiter property has not been fixed.
Steps to Reproduce
No response
Important Factoids
No response
References
Please see issue #13545. It is Resolved but row_delimiter property has not been fixed.