August 15, 2023

tAzureStorageContainerCreate – Docs for ESB 6.x

tAzureStorageContainerCreate

Creates a new storage container used to hold Azure blobs (Binary Large Object) for
a given Azure storage account.

tAzureStorageContainerCreate Standard properties

These properties are used to configure
tAzureStorageContainerCreate running in the
Standard Job framework.

The Standard
tAzureStorageContainerCreate component belongs to the
Cloud family.

The component in this framework is generally available.

Basic settings

Property Type

Select the way the connection details
will be set.

  • Built-In: The connection details will be set
    locally for this component. You need to specify the values for all
    related connection properties manually.

  • Repository: The connection details stored
    centrally in Repository > Metadata will be reused by this component. You need to click
    the […] button next to it and in the pop-up
    Repository Content dialog box, select the
    connection details to be reused, and all related connection
    properties will be automatically filled in.

This property is not available when other connection component is selected
from the Connection Component drop-down list.

Connection Component

Select the component whose connection details will be
used to set up the connection to Azure storage from the drop-down list.

Account Name

Enter the name of the storage account you need to access. A storage account
name can be found in the Storage accounts dashboard of the Microsoft Azure Storage
system to be used. Ensure that the administrator of the system has granted you the
appropriate access permissions to this storage account.

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.

Use Azure Shared Access Signature

Select this check box to use a shared access signature (SAS) to access the
storage resources without need for the account key. For more information,
see Using Shared Access Signatures
(SAS)
.

In the Azure Shared Access Signature field displayed,
enter your account SAS URL between double quotation marks. You can get the
SAS URL for each allowed service on Microsoft Azure portal after generating
SAS. The SAS URL format is
https://<$storagename>.<$service>.core.windows.net/<$sastoken>,
where <$storagename> is the storage account name,
<$service> is the allowed service name
(blob, file,
queue or table), and
<$sastoken> is the SAS token value. For more
information, see Constructing the Account SAS
URI
.

Note that the SAS has valid period, you can set the start time at which the
SAS becomes valid and the expiry time after which the SAS is no longer valid
when generating it, and you need to make sure your SAS is still valid when
running your Job.

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 the 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.

Global Variables

CONTAINER

The name of the blob container. This is an After variable and it
returns a string.

ERROR_MESSAGE

The error message generated by the component when an error occurs. This
is an After variable and it returns a string.

Usage

Usage rule

This component can be used as a standalone component of a Job or Subjob.

Prerequisites

Knowledge about Microsoft Azure Storage is required.

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.

use_case-tazurestoragecreate1.png

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.
  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.

    use_case-tazurestoragecreate2.png

  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.

    use_case-tazurestoragecreate3.png

  2. Select
    the component
    whose
    connection
    details will be used to set up the Azure storage connection.
    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.

    use_case-tazurestoragecreate4.png

  2. Select
    the component whose connection details will be used to set up the Azure storage
    connection. 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.

    use_case-tazurestoragecreate5.png

  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.

    use_case-tazurestoragecreate6.png

  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

  1. Press F6 to run this
    Job.
  2. Check the execution result on the Run console.

    use_case-tazurestoragecreate7.png

    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.

  3. Double-check the result in the web console of the Azure storage account.

    use_case-tazurestoragecreate8.png

    You can read as well that the talendcontainer
    container has been created.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x