ayanpan / azure-blob-storage-connectivity-using-boomi

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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Azure Blob Storage Connectivity using Boomi

Introduction

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.

Azure Blob Storage Authorization with Shared Key

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.

image

Container Name and Blob Name can be found in “Overview” section in the Storage Account.

image

Implement CREATE Operation

Overall Boomi process to create blob in Azure Blob Storage is as below. image

Sub-process to create blobs in Azure Blob Storage is as below. image

Step-1: Set blob content.

image

Step-2: Set properties for blob creation.

image

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.

image

Step-4: Create blob in Azure Blob Storage.

image

image

image

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

Implement LIST Operation

Overall Boomi process to list blobs from container in Azure Blob Storage is as below.

image

Sub-process to list blobs from container in Azure Blob Storage is as below.

image

Step-1: Set properties to list blobs from container.

image

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.

image

Step-3: List blobs from container in Azure Blob Storage.

image

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

Implement GET Operation

Overall Boomi process to get the blob content from container in Azure Blob Storage is as below.

image

Sub-process to get the blob content from container in Azure Blob Storage is as below.

image

Step-1: Split data based on “Blob” element from XML returned by List operation.

image

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.

image

Step-2: Set properties to get blobs.

image

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.

image

Step-4: Get blob content.

image

image

image

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

Implement DELETE Operation

Overall Boomi process to delete blob from Azure Blob Storage is as below. image

Sub-process to delete blob from Azure Blob Storage is as below.

image

Step-1: Set properties for blob deletion.

image

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.

image

Step-3: Generate signature to perform DELETE operation.

image

Step-4: Delete blob from Azure Blob Storage.

image

image

image

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.

Process Script

Language: Groovy 2.4

Code: Please refer "Generate Azure Blob Signature.groovy" file.

About

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.

License:Creative Commons Zero v1.0 Universal


Languages

Language:Groovy 100.0%