Microsoft Azure Data Lake File Append Operation
Tags: azure, integration, tutorial
Published: 2021-07-29 09:05:09

---
title: Microsoft Azure Data Lake File Append Operation
published: true
date: 2021-07-19 10:41:33 UTC
tags: #azure, #integration, #tutorial
canonical_url: https://tech.forums.softwareag.com/t/microsoft-azure-data-lake-file-append-operation/242979
---

## Summary:

This article describes the step-by-step process of Appending a file data to the Microsoft Azure Data Lake Gen 2 in On-premise environment.

## Pre-requisites:

• The user needs to have a working Microsoft Azure Data Lake Subscription & API Access.   
  
• License for the Integration server 10.5 or above.

## Contents:

• How to append a file data to the Microsoft Azure Data Lake Gen2.

## Note:

Any coding or configuration examples provided in this document are only examples and are not intended for use in a production system without verification. The example is only done here to better explain and visualize the possibilities.

## Steps:

1. Microsoft Azure Data Lake Gen2 is a Container based storage system, we will create a storage first to append the data. Ex: - Let’s create the Container named: - cscdemo.
2. Create the ccs (cloud connector service) & choose the “Filesystem” service, inside the services, choose “Create Filesystem” operation.
![1](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/a/ea7240d4c90c674da1f48b11a80c4f8701562635.png)
3. Run the ccs & provide the filesystem name as: - “cscdemo” then click “OK”.
![2](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/0/705853ecf1b203a8d288480a0a1451c3b49f7239.png)
4. Successful response shows the below messages. In the Azure UI, this container will be visible.
![3](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/d/ed37de420a53489084d8310b736c540b052b8758.png)
![4](https://aws1.discourse-cdn.com/techcommunity/original/3X/c/6/c699544427e301323ef0e80bb8bac712c4c3fc02.png)
5. Now container is ready for use, we will create an empty text file. This empty test file will act like a place holder. Once we push any data to this file, all the data will reside in this text file.
6. Create new ccs & choose the “Path” service, then choose the “Create or Rename a file or Directory” operation.
7. Run the ccs, Fill the details like:- filesystem name (Container name), path (Name of the text file, user wants to create), resource (Path:- text file, or a directory , means folder) then click “OK”.
![5](https://aws1.discourse-cdn.com/techcommunity/original/3X/4/7/47158ad498e32ed7b11593290b54e90f901793a0.png)
8. The successful api call shows the below response & same text file or folder will reflect in the Azure UI.
![6](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/6/b681381690e99db9553eea9cfdf65006f1c8b466.png)
![7](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/9/d/9d171bfbf3381ab2cc8fd4971da3075e8d8700d5_2_690x317.png)
9. As user can see in the above images, the text file is getting created successfully in the Azure UI, the size of this text file is “0B”, i.e.:- the file is empty & there is no any data inside this file.
10. Now will append some data to this text file, create a new ccs & choose the “Path” service then choose “Append files” operation, click “finish” then choose the parameter :- “position” as well then save the ccs.
![8](https://aws1.discourse-cdn.com/techcommunity/original/3X/5/a/5ad28db446d261f80706a54086ed2babe18dac9d.png)
11. Now create the demo flow service as mentioned below.
![9](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/3/7345f4733ace9d57a3332ffceb93981486de8017.png)
12. Inside this demo flow service, invoke the “pub. getFile” service in-order to read some text file from your local system.
![10](https://aws1.discourse-cdn.com/techcommunity/original/3X/1/9/19344361bfc260b4eb6e2b27e34d3ba820d0fc88.png)
13. Now, drag & drop the “Append file” ccs, that we have created at the step 10. Now click on the pipeline tab & choose the “getFile” service.
![11](https://aws1.discourse-cdn.com/techcommunity/original/3X/5/9/59460b7bf3dde72827948f537030e8a867b0455b.png)
14. Let’s create a text file in the local system, that contains 5 letters ex:- “Hello” then we will map the path of local text file to the “filename” parameters of the pub.getFile service, so that it reads the local system text file successfully. Ex: - C:\licenses\cscdemo.txt (I have created a local text file csc\_demo.txt that contains 5 letters “Hello”)
15. Fill the above parameters like: - “filename”, “LoadAs” as mentioned below.  
Filename: - C:\licenses\cscdemo.txt  
LoadAs: - stream.
16. Apply the mapping as mentioned below. Fill the parameters of “appendCallInput” as below: -  
Filesystem: - container name created in step 3.  
Path: - text file name created in the step 7,8.  
Action: - append.  
Position: - 0 (As we want to append the data from the beginning of the file)
![12](https://aws1.discourse-cdn.com/techcommunity/original/3X/d/b/db887e9a4389d6dd9de7e39825cf2143a7041b80.png)
17. Once all the mappings & data applied successfully, run this demo flow, a successful response show like below.
![13](https://aws1.discourse-cdn.com/techcommunity/original/3X/7/0/70c4d2b39bc88a289e1d048be12bbfb1ef43d5bc.png)
18. Now the data sent to azure active directory, but still, it’s not committed yet on Azure text file. To commit this data, we need to perform the flush operation. Create the ccs, choose the “Path” service, choose “Flush Data, Set ACL and properties” operation. Choose the additional parameters like: - “position”, “retainUncommitedData”.
19. Run the ccs, with the correct parameter’s values: -  
Position: - 5 (our local text file contains the 5 letters “Hello”)  
retainUncommitedData: - true
![14](https://aws1.discourse-cdn.com/techcommunity/original/3X/e/a/ea5b3447cfac11829f8d4eb146977c50f9293b25.png)
The successful call shows below response.
![15](https://aws1.discourse-cdn.com/techcommunity/original/3X/b/7/b7db4ebd93c3fe68b2ac49b4df80da261a637eca.png)
1. Now observe the size in the azure UI, its “5B” now. Means the data has appended successfully.
![16](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/3/3/33bf53fc7d02e51c059d38f3c37acf3d62e7122f_2_690x260.png)

[Read full topic](https://tech.forums.softwareag.com/t/microsoft-azure-data-lake-file-append-operation/242979)