tAzureStorageContainerCreate - 6.3

Talend Components Reference Guide

EnrichVersion
6.3
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

Function

tAzureStorageContainerCreate connects to a given Azure storage account and creates a container for this account.

Purpose

tAzureStorageContainerCreate creates a new storage container that you can use to hold Azure blobs (Binary Large Object).

tAzureStorageContainerCreate properties

Component Family

Cloud / Azure Storage

 

Basic settings

Use an existing connection

Select this check box and in the Component List click the relevant connection component to reuse the connection details you already defined.

 

Account name

Enter the name of the storage account you need to access. A storage account name can be found in the Manage Access Keys dashboard of the Microsoft Azure Storage system to be used.

 

Account key

Enter the key associated with the storage account you need to access. Two keys are available for each account and by default, either of them can be used for this access.

 

Protocol

Select the protocol for this connection to be created.

 

Container name

Enter the name of the blob container you need to create.

 

Access control

Select the access restriction level you need to apply on the container to be created.

 

Die on error

Select this check box to stop the execution of the Job when an error occurs.

Clear the check box to skip any rows on error and complete the process for error-free rows. When errors are skipped, you can collect the rows on error using a Row > Reject link.

Advanced settings

tStatCatcher Statistics

Select this check box to gather the Job processing metadata at the Job level as well as at each component level.

Usage

This component is used as a standalone component.

Knowledge about Microsoft Azure Storage is required.

Log4j

If you are using a subscription-based version of the Studio, the activity of this component can be logged using the log4j feature. For more information on this feature, see Talend Studio User Guide.

For more information on the log4j logging levels, see the Apache documentation at http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html.

Limitation

n/a

Global Variables

ERROR_MESSAGE: the error message generated by the component when an error occurs. This is an After variable and it returns a string. This variable functions only if the Die on error check box is cleared, if the component has this check box.

A Flow variable functions during the execution of a component while an After variable functions after the execution of the component.

To fill up a field or expression with a variable, press Ctrl + Space to access the variable list and choose the variable to use from it.

For further information about variables, see Talend Studio User Guide.

Scenario: Creating a container in Azure Storage

In this scenario, a four-component Job uses Azure Storage components to create a container in a given Azure Storage system and check whether this container is successfully created.

Before replicating this scenario, you must have appropriate rights and permissions to read and write files in the Azure storage account to be used. For further information, see Microsoft's documentation for Azure Storage: http://azure.microsoft.com/en-us/documentation/services/storage/.

Linking the components

  1. In the Integration perspective of the Studio, create an empty Job, named azureTalend for example, from the Job Designs node in the Repository tree view.

    For further information about how to create a Job, see Talend Studio User Guide.

  2. Drop tAzureStorageConnection, tAzureStorageContainerCreate, tAzureStorageContainerExist and tJava onto the workspace.

  3. Connect them using the Trigger > OnSubjobOk link.

Connecting to an Azure storage account

  1. Double-click tAzureStorageConnection to open its Component view.

  2. In the Account name field, enter the name of the storage account to be connected to. In this example, it is talendstorage, an account that has been created for demonstration purposes.

  3. In the Account key field, paste the primary or the secondary key associated with the storage account to be used. These keys can be found in the Manage Access Key dashboard in the Azure Storage system to be connected to.

  4. From the Protocol list, select the protocol for the endpoint of the storage account to be used. In this example, it is HTTPS.

Creating a container

  1. Double-click tAzureStorageContainerCreate to open its Component view.

  2. Select the Use an existing connection check box and then select the connection you have configured earlier. In this example, it is tAzureStorageConnection_1.

  3. In the Container name field, enter the name of the container you need to create. If a container using the same name exists, that container will be overwritten at runtime.

  4. From the Access control list, select the access restriction level for the container to be created. In this example, select Private.

Verifying the creation

  1. Double-click tAzureStorageContainerExist to open its Component view.

  2. Select the Use an existing connection check box and then select the connection you have configured earlier. In this example, it is tAzureStorageConnection_1.

  3. In the Container name field, enter the name of the container you need to check whether it exists.

  4. Double-click tJava to open its Component view.

  5. In the Code field, enter

    System.out.println();
  6. In the Outline panel, which, by default, is found to the left side of the Component view, expand the tAzureStorageContainerExist node.

  7. From the Outline panel, drop the CONTAINER_EXSIT global variable into the parentheses in the code in the Component view in order to make the code read:

    System.out.println(((Boolean)globalMap.get("tAzureStorageContainerExist_1_CONTAINER_EXIST")));

Executing the Job

  • Press F6 to run this Job.

Once done, the Run view is opened automatically, where you can check the execution result.

You can read that the Job returns true as the verification result, that is to say, the talendcontainer container has been created in the storage account being used.

In the web console of the Azure storage account, you can read as well that the talendcontainer container has been created.