Skip to main content

AZBLOB Library

The AZBLOB Library is an importable library containing functions to read, upload, list and delete blobs in the blob storage container and utilizes Entra ID authentication. This library is used in the Azure Blob Storage Adapter.

When imported into projects, typically only the AZBLOBclient module needs to be required in order to create the client and access the API methods.

require "AZBLOB.AZBLOBclient"   

How it works:

Use the Translator's built in help to review how to use each function:

AZBLOBclient - sets up the adapter framework

Sets up the Azure Blob Storage Adapter framework, adding the various method modules to a metatable and storing the configurations added to the custom fields.

methods/AZBLOBcustom - makes API requests and returns the response

AZBLOBcustom takes in any API requests and parameters to make the API call and return the response. It also handles the output and error handling for any pre-built functions like AZBLOBput and AZBLOBget.

  • First, the function checks if the token key exists. If not, it calls AZBLOBauth to perform the authentication workflow to obtain the token to be used in subsequent requests. It also handles expired tokens as well.

  • Uses the passed configurations API request parameters - the method (ex. post), API and any parameters for the call to build and carry out the appropriate HTTP request.

methods/AZBLOBsearch - prepares the parameters and calls AZBLOBcustom to search the container and return the results of the search

AZBLOBsearch prepares the parameters and calls AZBLOBcustom for a search operation. The function returns an XML response that can be parsed in Iguana.

methods/AZBLOBput - prepares the parameters and calls AZBLOBcustom for a put request

AZBLOBput prepares the API endpoint and parameters to call AZBLOBcustom, it takes in a full path and the data to be uploaded as parameters.

If successful, the data is uploaded with the given file name and if a subfolder is defined in the path but does not exist, it will be created and the blob will be placed within.

methods/AZBLOBget - prepares the parameters and calls AZBLOBcustom for a get request

AZBLOBget prepares the API endpoint and parameters to call AZBLOBcustom, it takes in a full blob path as a parameter.

If successful, the data within the given blob is returned, otherwise an XML error is returned.

methods/AZBLOBdelete - prepares the parameters and calls AZBLOBcustom for a delete request

AZBLOBdelete prepares the API endpoint and parameters to call AZBLOBcustom, it takes in a full blob path and the delete_blob as parameters.

the delete_blob parameter is used to control whether to delete the blob and its snapshots or just the snapshots.