Skip to content

azure.storage.read

azure · scripts/+azure/+storage/read.m

: data = azure.storage.read (container, blob)
: data = azure.storage.read (container, blob, …)

Read the contents of an Azure Blob Storage blob.

azure.storage.read (container, blob) reads the blob identified by container and blob from Azure Blob Storage and returns its raw content as a uint8 column vector.

The connection is authenticated via Azure Shared Key. Credentials can be supplied as name-value pairs or taken from environment variables:

  • "AccountName", name and "AccountKey", key — the storage account name (lowercase letters and digits) and the 64-byte base64-encoded account key.
  • "SAS", token — a Shared Access Signature query token. When provided the SAS token is appended directly to every request; AccountKey is not used.

If neither credentials nor a SAS token are supplied explicitly, the function reads AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_KEY.

Example:

  data = azure.storage.read ("mycontainer", "myfile.txt", ...
    "AccountName", "mystorage", "AccountKey", "abc123==")