Azure Blob storage is a service provided by Microsoft that stores unstructured data in the cloud as objects/blobs. Blob storage can store any type of text or binary data, such as a document, media file, or application installer. Blob storage is also referred to as object storage.
This forum post will explain how you can use the Adeptia Integration Suite to integrate with Microsoft BLOB storage to read, write and delete files.
Steps to implement the data integration with BLOB Storage are outlined below.
- Download the attached jar files(azure-storage-4.0.0.jar & AzureBlobManager.jar) and place them in "\AdeptiaSuite-6."x\AdeptiaServer\ServerKernel\ext". Restart Adeptia services after placing these files.
- Use the attached custom plugin codes to read, write and delete files from Microsoft Azure BLOB Storage.
Create custom plugins by going to Develop --> Services --> Extensions --> Custom Plugin. Copy the attached custom plugin code and paste in the "Script" of your Custom Plugin to read, write, and delete files from Microsoft Azure BLOB Storage. These Custom Plugins can then be used in your process flows at the described locations below. - You need to set the following key values in context using Put-context Var with the given names in the custom plugin code :
Variable Names Variable Values
accountName : Azure Blob account Name
accountKey : Azure Blob account key
protocol : HTTP or HTTPS
container : Container name in AZURE BLOB storage where file has to be uploaded/downloaded.
createContainer: Create the container if it doesn't exist in case of Upload. Value could be true/false.(NOTE: Container name should be in Lower Case)
fileLocation : Location of file including File Name that is to be uploaded.
deleteFileOnSuccess : Delete file from Local location in case of Upload. Value should be true or false.
fileName : Name of file that has to be downloaded from AZURE BLOB.
fileDownloadLocation: Location where file has to be stored in case of Download.
Upload File to BLOB Storage
Suppose you need to write a file from local Source location to Microsoft Azure BLOB Storage then you can use the attached custom plugin, CP_UploadToAzurePlugin.txt, before that make sure to set all variables in context :
• Create a custom plugin to upload a file using attached file "CP_UploadToAzurePlugin.txt".
• Use this Custom plugin in Process flow Designer.
• Set Generate Stream and Consume Stream properties of Custom Plugin to False.
• Use Put-Context Var before this Plugin activity.
• Define all the required variables from step 3 with their respective values.
Download file from Azure BLOB:
• Create a custom plugin to upload a file using attached file "CP_DownloadFromAzurePlugin.txt".
• Use this Custom plugin in Process flow Designer.
• Set Generate Stream and Consume Stream properties of Custom Plugin to False.
• Use Put-Context Var before this Plugin activity.
• Define all the required variables from step 3 with their respective values.
Delete File/Container from directory:
If you want to delete File or Container from Azure BLOB then please use the attached code("DeleteAzureFileContainerPlugin.txt") and define all the context variables in the Process Flow Designer. This method can also be used with Download plugin after downloading the File.
Comments
0 comments
Article is closed for comments.