Azure Blob Storage client object

AzureClient() // object constructor

This function creates and returns a new AzureClient object, which is the AFT object that implements and carries out all file transfers and related operations using the Microsoft Azure Blob Storage protocol.

Here’s the protocol-specific properties that you may have to initialize/configure before calling the .Connect() method:

Container:              string
AccountName:            string
AccountKey:             string
AccountKeyFromSecret:   string
UseMetadataWhenListing: boolean

Container: this is the name of the Azure Blob container that you have chosen and assigned to your container when you have originally created it (other cloud vendors call this “bucket” but in Azure’s terminology it’s called “Container”.

AccountName: this is the Account Name for this Azure Storage Account.

AccountKey: every AccountName has a corresponding secret AccountKey in your Azure account. This is such key. We do not recommend, though, that you write your secrets in clear in your script code, so either use the GetSecret function to populate this value, or use the AccountKeyFromSecret property here below (better choice).

AccountKeyFromSecret: if you have stored your AccountKey as AFT! secret (read more about secrets) then you can set this property to the name of the secret in AFT!’s database; this is the safest choice.

UseMetadataWhenListing: this property is by default set to false to optimize the speed of your directory listing and file searching commands. Setting this property to true will slow down directory lists and file searches by a remarkable factor, but it will - in turn - enable the acquisition of the object’s metadata, which include the correct TimeStamp of the last modification date of the object. Unfortunately Azure doesn’t return such information in the normal directory list, so this option necessarily needs to be set to true if your script is using the AdjustTimeOnUpload or AdjustTimeOnDownload options. This is the only way to make sure that the returned TimeStamp matches the custom TimeStamp you set, and not the timestamp that AWS arbitrarily assigns to the object.


As opposed to other cloud platforms, in Azure Blob Storage all folders are “virtual”. They exist only when there’s at least one blob in them, and disappear by themselves when they’re emptied. This implies the following peculiarities in the AzureClient object behavior that differ from all other AFT! client objects:

  • MakeDir always succeeds (returns true) but truthfully it does absolutely nothing

  • RenDir is not supported and always return false (a non-existent object cannot be renamed)

Please, keep in mind that once created you (the programmer) have the responsibility of freeing the memory allocated by the object at the end of its use. You can easily do so by simply setting the object to null once you’re done using it (as shown in the example below).


  var cli = new AzureClient();
  cli.Container = 'yourblobcontainername';
  cli.AccountName = 'your_account_name';
  cli.AccountKeyFromSecret = 'your_secret_name';
  if (cli.Connect()) {
    // perform your file transfers...
    // ...
    // ...
  cli = null