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.54k stars 4.61k forks source link

Support for azurerm_data_factory_linked_service_azure_batch in ADF(Azure Data Factory) #19737

Open meghdivya opened 1 year ago

meghdivya commented 1 year ago

Is there an existing issue for this?

Community Note

Description

Currently from the azure portal one can create an azure batch linked service in azure data factory by going into compute option, terraform doesn't have support for this.

New resource type is needed when working with azure batch compute from the ADF(Azure data factory).

It could be named like below.

azurerm_data_factory_linked_service_azure_batch

New or Affected Resource(s)/Data Source(s)

New

Potential Terraform Configuration

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_batch" "example" {
  name              = "example"
  data_factory_id   = azurerm_data_factory.example.id
  connection_string = ""
}

References

https://techcommunity.microsoft.com/t5/azure-paas-blog/configure-a-simple-azure-batch-job-with-azure-data-factory/ba-p/2260759

ms-henglu commented 1 year ago

Hi @meghdivya ,

Thank you for taking time to report this issue!

data_factory_linked_custom_service is a generic resource that supports all different Linked Service Types. Would you please give it a try? Thanks!

meghdivya commented 1 year ago

I checked the terraform documentation. data_factory_linked_service has type field which has "connectors" documentation. Azure documentation doesn't mention azure batch in that. @ms-henglu below documentation for your reference. https://learn.microsoft.com/en-in/azure/data-factory/connector-overview

ms-henglu commented 1 year ago

Hi @meghdivya - Please check this document for the available properties. https://learn.microsoft.com/en-us/azure/templates/microsoft.datafactory/factories/linkedservices?pivots=deployment-language-terraform#azurebatchlinkedservice-2

type = "AzureBatch"
  typeProperties = {
    accessKey = {
      type = "string"
      // For remaining properties, see SecretBase objects
    }
    credential = {
      referenceName = "string"
      type = "CredentialReference"
    }
    linkedServiceName = {
      parameters = {}
      referenceName = "string"
      type = "LinkedServiceReference"
    }
  }