Skip to content

azurermDataFactoryLinkedServiceKusto

Manages a Linked Service (connection) between a Kusto Cluster and Azure Data Factory.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermDataFactoryExample = new azurerm.dataFactory.DataFactory(
  this,
  "example_1",
  {
    identity: [
      {
        type: "SystemAssigned",
      },
    ],
    location: azurermResourceGroupExample.location,
    name: "example",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermDataFactoryExample.overrideLogicalId("example");
const azurermKustoClusterExample = new azurerm.kustoCluster.KustoCluster(
  this,
  "example_2",
  {
    location: azurermResourceGroupExample.location,
    name: "kustocluster",
    resource_group_name: azurermResourceGroupExample.name,
    sku: [
      {
        capacity: 2,
        name: "Standard_D13_v2",
      },
    ],
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermKustoClusterExample.overrideLogicalId("example");
const azurermKustoDatabaseExample = new azurerm.kustoDatabase.KustoDatabase(
  this,
  "example_3",
  {
    cluster_name: azurermKustoClusterExample.name,
    location: azurermResourceGroupExample.location,
    name: "my-kusto-database",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermKustoDatabaseExample.overrideLogicalId("example");
const azurermKustoDatabasePrincipalAssignmentExample =
  new azurerm.kustoDatabasePrincipalAssignment.KustoDatabasePrincipalAssignment(
    this,
    "example_4",
    {
      cluster_name: azurermKustoClusterExample.name,
      database_name: azurermKustoDatabaseExample.name,
      name: "KustoPrincipalAssignment",
      principal_id: `\${${azurermDataFactoryExample.identity}.0.principal_id}`,
      principal_type: "App",
      resource_group_name: azurermResourceGroupExample.name,
      role: "Viewer",
      tenant_id: `\${${azurermDataFactoryExample.identity}.0.tenant_id}`,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermKustoDatabasePrincipalAssignmentExample.overrideLogicalId("example");
const azurermDataFactoryLinkedServiceKustoExample =
  new azurerm.dataFactoryLinkedServiceKusto.DataFactoryLinkedServiceKusto(
    this,
    "example_5",
    {
      data_factory_id: azurermDataFactoryExample.id,
      kusto_database_name: azurermKustoDatabaseExample.name,
      kusto_endpoint: azurermKustoClusterExample.uri,
      name: "example",
      use_managed_identity: true,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermDataFactoryLinkedServiceKustoExample.overrideLogicalId("example");

Argument Reference

The following supported arguments are common across all Azure Data Factory Linked Services:

  • name - (Required) Specifies the name of the Data Factory Linked Service. Changing this forces a new resource to be created. Must be unique within a data factory. See the Microsoft documentation for all restrictions.

  • dataFactoryId - (Required) The Data Factory ID in which to associate the Linked Service with. Changing this forces a new resource.

  • description - (Optional) The description for the Data Factory Linked Service.

  • integrationRuntimeName - (Optional) The integration runtime reference to associate with the Data Factory Linked Service.

  • annotations - (Optional) List of tags that can be used for describing the Data Factory Linked Service.

  • parameters - (Optional) A map of parameters to associate with the Data Factory Linked Service.

  • additionalProperties - (Optional) A map of additional properties to associate with the Data Factory Linked Service.

The following supported arguments are specific to Azure Kusto Linked Service:

  • kustoEndpoint - (Required) The URI of the Kusto Cluster endpoint.

  • kustoDatabaseName - (Required) The Kusto Database Name.

  • useManagedIdentity - (Optional) Whether to use the Data Factory's managed identity to authenticate against the Kusto Database.

  • servicePrincipalId - (Optional) The service principal id in which to authenticate against the Kusto Database.

  • servicePrincipalKey - (Optional) The service principal key in which to authenticate against the Kusto Database.

  • tenant - (Optional) The service principal tenant id or name in which to authenticate against the Kusto Database.

\~> NOTE If servicePrincipalId is used, servicePrincipalKey and tenant is also required.

\~> NOTE One of Managed Identity authentication and Service Principal authentication must be set.

Attributes Reference

The following attributes are exported:

  • id - The ID of the Data Factory Linked Service.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Data Factory Linked Service.
  • update - (Defaults to 30 minutes) Used when updating the Data Factory Linked Service.
  • read - (Defaults to 5 minutes) Used when retrieving the Data Factory Linked Service.
  • delete - (Defaults to 30 minutes) Used when deleting the Data Factory Linked Service.

Import

Data Factory Linked Service's can be imported using the resourceId, e.g.

terraform import azurerm_data_factory_linked_service_kusto.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example/linkedservices/example