Skip to content

azurermDataFactoryLinkedServiceAzureBlobStorage

Manages a Linked Service (connection) between an Azure Blob Storage Account and Azure Data Factory.

\~> Note: All arguments including the client secret will be stored in the raw state as plain-text. Read more about sensitive data in state.

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 dataAzurermStorageAccountExample =
  new azurerm.dataAzurermStorageAccount.DataAzurermStorageAccount(
    this,
    "example_1",
    {
      name: "storageaccountname",
      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.*/
dataAzurermStorageAccountExample.overrideLogicalId("example");
const azurermDataFactoryExample = new azurerm.dataFactory.DataFactory(
  this,
  "example_2",
  {
    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 azurermDataFactoryLinkedServiceAzureBlobStorageExample =
  new azurerm.dataFactoryLinkedServiceAzureBlobStorage.DataFactoryLinkedServiceAzureBlobStorage(
    this,
    "example_3",
    {
      connection_string:
        dataAzurermStorageAccountExample.primaryConnectionString,
      data_factory_id: azurermDataFactoryExample.id,
      name: "example",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermDataFactoryLinkedServiceAzureBlobStorageExample.overrideLogicalId(
  "example"
);

Example Usage with SAS URI and SAS Token

/*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 dataAzurermClientConfigCurrent =
  new azurerm.dataAzurermClientConfig.DataAzurermClientConfig(
    this,
    "current",
    {}
  );
const azurermDataFactoryTest = new azurerm.dataFactory.DataFactory(
  this,
  "test",
  {
    location: azurermResourceGroupExample.location,
    name: "example",
    resource_group_name: azurermResourceGroupExample.name,
  }
);
const azurermKeyVaultTest = new azurerm.keyVault.KeyVault(this, "test_3", {
  location: azurermResourceGroupExample.location,
  name: "example",
  resource_group_name: azurermResourceGroupExample.name,
  sku_name: "standard",
  tenant_id: dataAzurermClientConfigCurrent.tenantId,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermKeyVaultTest.overrideLogicalId("test");
const azurermDataFactoryLinkedServiceKeyVaultTest =
  new azurerm.dataFactoryLinkedServiceKeyVault.DataFactoryLinkedServiceKeyVault(
    this,
    "test_4",
    {
      data_factory_id: azurermDataFactoryTest.id,
      key_vault_id: azurermKeyVaultTest.id,
      name: "linkkv",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermDataFactoryLinkedServiceKeyVaultTest.overrideLogicalId("test");
const azurermDataFactoryLinkedServiceAzureBlobStorageTest =
  new azurerm.dataFactoryLinkedServiceAzureBlobStorage.DataFactoryLinkedServiceAzureBlobStorage(
    this,
    "test_5",
    {
      data_factory_id: azurermDataFactoryTest.id,
      key_vault_sas_token: [
        {
          linked_service_name: azurermDataFactoryLinkedServiceKeyVaultTest.name,
          secret_name: "secret",
        },
      ],
      name: "example",
      sas_uri: "https://example.blob.core.windows.net",
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermDataFactoryLinkedServiceAzureBlobStorageTest.overrideLogicalId("test");

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 Blob Storage Linked Service:

  • connectionString - (Optional) The connection string. Conflicts with connectionStringInsecure, sasUri and serviceEndpoint.

  • connectionStringInsecure - (Optional) The connection string sent insecurely. Conflicts with connectionString, sasUri and serviceEndpoint.

\~> Note: connectionString uses the Azure SecureString to encrypt the contents within the REST payload sent to Azure whilst the connectionStringInsecure is sent as a regular string. Both properties are still sent using SSL/HTTPS. At this time the portal will not decrypt Secure Strings so the connectionString property in the portal will show as ****** whilst connectionStringInsecure will be viewable in the portal.

  • sasUri - (Optional) The SAS URI. Conflicts with connectionStringInsecure, connectionString and serviceEndpoint.

  • keyVaultSasToken - (Optional) A keyVaultSasToken block as defined below. Use this argument to store SAS Token in an existing Key Vault. It needs an existing Key Vault Data Factory Linked Service. A sasUri is required.


A keyVaultSasToken block supports the following:

  • linkedServiceName - (Required) Specifies the name of an existing Key Vault Data Factory Linked Service.

  • secretName - (Required) Specifies the secret name in Azure Key Vault that stores the SAS token.


  • servicePrincipalLinkedKeyVaultKey - (Optional) A servicePrincipalLinkedKeyVaultKey block as defined below. Use this argument to store Service Principal key in an existing Key Vault. It needs an existing Key Vault Data Factory Linked Service.

A servicePrincipalLinkedKeyVaultKey block supports the following:

  • linkedServiceName - (Required) Specifies the name of an existing Key Vault Data Factory Linked Service.

  • secretName - (Required) Specifies the secret name in Azure Key Vault that stores the Service Principal key.


  • serviceEndpoint - (Optional) The Service Endpoint. Conflicts with connectionString, connectionStringInsecure and sasUri.

  • useManagedIdentity - (Optional) Whether to use the Data Factory's managed identity to authenticate against the Azure Blob Storage account. Incompatible with servicePrincipalId and servicePrincipalKey.

  • servicePrincipalId - (Optional) The service principal id in which to authenticate against the Azure Blob Storage account.

  • servicePrincipalKey - (Optional) The service principal key in which to authenticate against the AAzure Blob Storage account.

  • storageKind - (Optional) Specify the kind of the storage account. Allowed values are storage, storageV2, blobStorage and blockBlobStorage.

  • tenantId - (Optional) The tenant id or name in which to authenticate against the Azure Blob Storage account.

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_azure_blob_storage.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example/providers/Microsoft.DataFactory/factories/example/linkedservices/example