Home > Back-end >  How to connect an Azure data factory to an HTTP endpoint using Terraform
How to connect an Azure data factory to an HTTP endpoint using Terraform

Time:05-26

I'm trying to ingest data from an http endpoint into an Azure Data Factory using Terraform. The first step would be to create a linked service within ADF pointing to an HTTP. This is easily doable on Azure UI; however, I have not found such resource within Terraform. There's no resource azurerm_data_factory_linked_service_http on Terraform. Here I've done it via UI:

enter image description here

But I'd like to do the same via Terraform so that I can manage it automatically using code. Anyone knows how to create this resource in Terraform? I'd appreciate it.

CodePudding user response:

Ok, it seems like Terraform has added azurerm_data_factory_linked_custom_service that supports all kinds of services like HTTP or Rest. I've followed the answer on this question. I finally managed to create my HTTP linked service using Terraform. Here's my codes:

resource "azurerm_data_factory" "covid-reporting-df" {
  name                = "covrepdf${local.my_name}"
  location            = azurerm_resource_group.covid-reporting-rg.location
  resource_group_name = azurerm_resource_group.covid-reporting-rg.name
}


resource "azurerm_data_factory_linked_custom_service" "adf-link-source-covid" {
  name            = "ls_https_ecdc_${local.my_name}"
  data_factory_id = azurerm_data_factory.covid-reporting-df.id
  type            = "HttpServer"

  type_properties_json = <<JSON
{
    "url": "https://opendata.ecdc.europa.eu",

    "enableServerCertificateValidation": true,

    "authenticationType": "Anonymous"
}
JSON

  annotations = []

}
  • Related