Azure Blob Storage is a cloud-based platform optimized for storing unstructured data, such as text or binary data. The stored file is called Blob and the directory where it’s stored is called Container.
The objective of this document is to show the generation of signature using Groovy script for HTTP requests’ Authorization header, to perform List, Get, Create and Delete operations in Azure Blob Storage.
The storage account name, storage account access key, and blob container name are required to perform communication/transaction between Boomi and Azure Blob Storage. The storage account name and access keys can be found by going to the Storage Account.
Step-1: Once you are in the desired storage account, go to Access keys.
Step-2: Click on Storage account name to get the storage account name.
Step-3: Click on Show keys.
Step-4: Copy Key 1.
Container Name and Blob Name can be found in “Overview” section in the Storage Account.
Overall Boomi process to create blob in Azure Blob Storage is as below.
Sub-process to create blobs in Azure Blob Storage is as below.
Step-1: Set blob content.
Step-2: Set properties for blob creation.
Account Name DPP: Name of Azure Blob Storage account
Access Key DPP: Value of Access Key obtained from Azure Blob Storage in Base64 encoded format
Container Name DPP: Name of Azure Blob Storage container where the blob need to be created
HTTP Verb DPP: PUT
Container Name DDP: Container Name DPP
Blob Name DDP: Name of the blob to be created
Content Type DPP: The required Content-Type of the blob, for example, text/plan, text/csv, etc.
Operation DPP: CREATE
Step-3: Generate signature to perform CREATE operation to create blob.
Step-4: Create blob in Azure Blob Storage.
Request Headers:
Authorization: Value obtained from Step-3
x-ms-date: Value obtained from Step-3
x-ms-version: 2020-10-02
x-ms-blob-type: BlockBlob
Resource Path:
Container Name DDP: <alue obtained from Step-2
/
Blob Name DDP: Value obtained from Step-2
Content Type: text/csv
Overall Boomi process to list blobs from container in Azure Blob Storage is as below.
Sub-process to list blobs from container in Azure Blob Storage is as below.
Step-1: Set properties to list blobs from container.
Account Name DPP: Name of Azure Blob Storage account
Access Key DPP: Value of Access Key obtained from Azure Blob Storage in Base64 encoded format
Container Name DPP: Name of Azure Blob Storage container where the blob need to be created
HTTP Verb DPP: GET
Container Name DDP: Container Name DPP
Operation DPP: LIST
Step-2: Generate signature to perform LIST operation to get a list of all the blobs present in a specified container.
Step-3: List blobs from container in Azure Blob Storage.
Request Headers:
Authorization: Value obtained from Step-2
x-ms-date: Value obtained from Step-2
x-ms-version: 2020-10-02
Resource Path:
Container Name DDP: Value obtained from Step-1
?restype=container&comp=list
Overall Boomi process to get the blob content from container in Azure Blob Storage is as below.
Sub-process to get the blob content from container in Azure Blob Storage is as below.
Step-1: Split data based on “Blob” element from XML returned by List operation.
XML File: Please refer "Azure Blob List XML.xml" file.
Note: If the blob name(s) in Azure contains space(s) in between words, for example, “Boomi Azure Blob Storage Demo.csv”, then replace space(s) with %20, as per below example.You may also use URL Encoding script to have special/encoded characters in file name.
Step-2: Set properties to get blobs.
Account Name DPP: Name of Azure Blob Storage account
Access Key DPP: Value of Access Key obtained from Azure Blob Storage in Base64 encoded format
Container Name DPP: Name of Azure Blob Storage container where the blob need to be created
HTTP Verb DPP: GET
Container Name DDP: Container Name DPP
Blob Name DDP: Name obtained from the XML profile>
Operation DPP: GET
Step-3: Generate signature to perform GET operation to get the blob content.
Step-4: Get blob content.
Request Headers:
Authorization: Value obtained from Step-3
x-ms-date: Value obtained from Step-3
x-ms-version: 2020-10-02
Resource Path:
Container Name DDP: Value obtained from Step-2
/
Blob Name DDP: Value obtained from Step-2
Overall Boomi process to delete blob from Azure Blob Storage is as below.
Sub-process to delete blob from Azure Blob Storage is as below.
Step-1: Set properties for blob deletion.
Account Name DPP: Name of Azure Blob Storage account
Access Key DPP: Value of Access Key obtained from Azure Blob Storage in Base64 encoded format
Container Name DPP: Name of Azure Blob Storage container where the blob need to be created
HTTP Verb DPP: DELETE
Container Name DDP: Container Name DPP
Operation DPP: DELETE
Step-2: Put a Message shape with no data, to remove any content before generating signature. This step is essential if there’s any incoming data to the payload before signature generation, to avoid error in the generated signature.
Step-3: Generate signature to perform DELETE operation.
Step-4: Delete blob from Azure Blob Storage.
Request Headers:
Authorization: Value obtained from Step-3
x-ms-date: Value obtained from Step-3
x-ms-version: 2020-10-02
Resource Path:
Container Name DDP: Value obtained from Step-1
/
Blob Name DDP: Value obtained from GET operation’s Set Property
Content Type: null.
Language: Groovy 2.4
Code: Please refer "Generate Azure Blob Signature.groovy" file.