Azure Storage Plugin

Provides AzureBlobStorageSource and AzureBlobStorageCache.

AzureBlobStorageSource

AzureBlobStorageSource maps a URL identifier to a Microsoft Azure Blob Storage blob.

This source is not meant to be used with blob SAS URLs. HTTPSource should be used instead.

Lookup Strategies

BasicLookupStrategy

BasicLookupStrategy locates images by passing the URL identifier as-is to the Blob Storage endpoint, with no additional configuration possible.

ScriptLookupStrategy

When your URL identifiers don't match your blob keys, ScriptLookupStrategy is available to tell AzureBlobStorageSource to capture the blob key returned by a method in your delegate class.

This delegate method, azureblobstoragesource_blob_info(), should return a hash containing container and name keys, if an object is available, or nil if not.

Format Inference

Like all sources, AzureBlobStorageSource needs to be able to figure out the format of a source image before it can be served. It uses the following strategy to do this:

  1. If the blob key has a recognized filename extension, the format is inferred from that.
  2. Otherwise, if the source image's URI identifier has a recognized filename extension, the format is inferred from that.
  3. Otherwise, a HEAD request is sent. If a Content-Type header is present in the response, and is specific enough (i.e. not application/octet-stream), a format is inferred from that.
  4. Otherwise, a GET request is sent with a Range header specifying a small range of data from the beginning of the resource, and a format is inferred from the magic bytes in the response body.

Random Access

This source supports random access using HTTP Range headers. See the HTTPSource section of the guide for an explanation of this feature.

AzureBlobStorageCache

AzureBlobStorageCache caches variant images and metadata into a Microsoft Azure Blob Storage container.

In order for AzureBlobStorageCache to operate as a least-recently-used (LRU) cache, you must enable access time tracking on your container. Otherwise, it will operate based on last-modified times, which is not ideal.

Azure Authentication

AzureBlobStorageSource and AzureBlobStorageCache support a variety of authentication methods:

  1. (AzureBlobStorageSource only) An account name and key can be returned from the azureblobstoragesource_blob_info() delegate method.
  2. If an account key is present in the config.yml file, shared key authentication will be used using that key.
  3. Several other strategies will be pursued in order by the DefaultAzureCredential class in the Azure SDK—see its documentation for more information.

Installation

Step 1: Install the plugin

Use the plugin installer:

bin/install_plugin.sh galia-plugin-azurestorage

Alternatively, download the plugin directly and extract it into Galia's plugins directory.

Step 2: Configure the plugins

Copy the keys from config.yml.sample into your application configuration file and fill them in.

Step 3: Implement the delegate method (optional; AzureBlobStorageSource only)

Copy the azureblobstoragesource_blob_info() method from delegates.rb.sample into your delegate script file, and implement it there.

Step 4: Enable AzureBlobStorageCache (optional)

If you would like to use AzureBlobStorageCache, you must tell Galia to use it as the variant cache and/or info cache by editing the following keys in your application configuration file:

cache.server.variant.enabled: true
cache.server.variant.implementation: AzureBlobStorageCache

cache.server.info.enabled: true
cache.server.info.implementation: AzureBlobStorageCache