I try to create a linked_service using this terraform command: azurerm_data_factory_linked_service_azure_sql_database.
The documentation says that we can use use_managed_identity (I use it as a boolean). I try to cobine it with credential_name which uses the outcome of this command azurerm_data_factory_credential_user_managed_identity
Imho documentation is quite poor and I couldn't find proper resources online.
In the same block i try to specify the connection string but I believe that I misconfigured it:
it looks like this:
resource "azurerm_data_factory_linked_service_azure_sql_database" "linked_service_for_xxxxx_database" {
name = "linked_service_for_xxxxxx_database"
data_factory_id = var.azure_data_factory_id (I created an adf instance and it depends on it)
use_managed_identity = true (should be boolean?)
credential_name = var.user_assigned_managed_identity_id (output of: azurerm_data_factory_credential_user_managed_identity)
integration_runtime_name = var.integration_runtime_name (outpout of: azurerm_data_factory_integration_runtime_azure)
connection_string = "data source=${var.xxxxx_sql_server_name (fully qualified domain name??)};Initial Catalog=${var.xxxx_sql_db_name};encrypt=True;connection timeout=30;"
}
I want the linked service to be of Authentication type: User-assigned managed Identity and use the credentials that I created above.
Fun fact:
I have this configuration which does not give me errors during init & plan (I haven't run apply yet)
resource "azurerm_data_factory_linked_service_data_lake_storage_gen2" "linked_service_for_azure_data_lake_storage" {
name = "linked_service_for_azure_data_lake_storage"
data_factory_id = var.azure_data_factory_id
url = "https://${var.adls_account_name}.dfs.core.windows.net"
use_managed_identity = var.user_assigned_managed_identity_id (I was expecting it to be bool but ....)
integration_runtime_name = var.integration_runtime_name
}


