Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_data_factory_dataset_azure_sql_table - Table not set #25957

Open
1 task done
Paxilein opened this issue May 14, 2024 · 4 comments
Open
1 task done

azurerm_data_factory_dataset_azure_sql_table - Table not set #25957

Paxilein opened this issue May 14, 2024 · 4 comments

Comments

@Paxilein
Copy link

Paxilein commented May 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.8.1

AzureRM Provider Version

3.103.1

Affected Resource(s)/Data Source(s)

azurerm_data_factory_dataset_azure_sql_table

Terraform Configuration Files

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_data_factory" "example" {
  name                = "example"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_data_factory_linked_service_azure_sql_database" "example" {
  name              = "example"
  data_factory_id   = azurerm_data_factory.example.id
  connection_string = "Integrated Security=False;Data Source=test;Initial Catalog=test;Initial Catalog=test;User ID=test;Password=test"
}

resource "azurerm_data_factory_dataset_azure_sql_table" "example" {
  name              = "example"
  data_factory_id   = azurerm_data_factory.example.id
  linked_service_id = azurerm_data_factory_linked_service_azure_sql_database.example.id
  schema = "dbo"
  table_name = "foo"
}

Debug Output/Panic Output

N/A

Expected Behaviour

The dataset should have the table "foo" configured in ADF, like it does when using the azurerm_data_factory_dataset_sql_server_table

Actual Behaviour

The table field in ADF Studio shows "Select..." and the "Enter manually" is disabled. We have to manually select a table before it works...
Maybe the manual field isn't configured to be set in this resource when the table is specified?

Steps to Reproduce

No response

Important Factoids

No response

References

No response

@Paxilein
Copy link
Author

There's also an inconsistency as the azurerm_data_factory_dataset_sql_server_table uses "table_name" and does not have "schema" while azurerm_data_factory_dataset_azure_sql_table uses "table" and "schema"!?

@Paxilein
Copy link
Author

Paxilein commented May 14, 2024

Another interesting thing I found...
After the deployment the typeproperties "schema" and "table" are set like I configured in Terraform...
However, when I choose the table from the dropdown it removes both of those typeproperties and puts a new typeproperty "tablename" there...

After deployment:
"typeProperties": {
"schema": "dbo",
"table": "foo"
}

After selecting the table from the dropdown:
"typeProperties": {
"tableName": "[dbo].[foo]"
}

I don't do GoLang but I think maybe the azurerm_data_factory_dataset_azure_sql_table just sets the wrong thing (table and schema) and should configure tablename instead, like the azurerm_data_factory_dataset_sql_server_table does?

@JustinSometimesWrong
Copy link

This is still an issue.

@damews
Copy link

damews commented Oct 24, 2024

@Paxilein I had this same issue when trying to use the azurerm_data_factory_dataset_azure_sql_table resource. After searching the "Azure Dataset Bicep" into Google, i landed on this doc: https://learn.microsoft.com/en-us/azure/templates/microsoft.datafactory/factories/datasets?pivots=deployment-language-terraform

After applying the resource using the azapi_resource as mentioned in the doc, the issue still occurred. One thing I noticed is that when the Dataset is created manually, the column schema is loaded automatically, and the JSON representation of the Dataset shows the column schema.

I added the column schema, applied it again, and this time it worked as expected. See if adding the column schema resolves the issue for you.

Obs: the azurerm_data_factory_dataset_azure_sql_table has the schema_columns block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants