Skip to content

Blob writer ​

Uploads text or a file stream to a blob in Azure Storage, or appends records to an append blob, and passes the input on. Sets content type, metadata and access tier, and can create the container.

Pins ​

PinKindTypesDescription
InputinputViaducta.Plugins.TextPlugin.Types.TextRecord, Viaducta.Plugins.Files.Types.ViaFileStreamContent to store: TextRecord.Value (UTF-8) or the stream.
Outputoutputsame as inputCalled with the input record after a successful write.

Configuration ​

FieldTypeDefaultDescription
Authenticationdropdown: 0 ConnectionString, 1 EntraId, 2 ServicePrincipal, 3 SasToken0How to sign in to the storage account.
ConnectionStringstringStorage connection string. Required when Authentication is 0.
AccountUrlstringBlob endpoint, for example https://myaccount.blob.core.windows.net, no query. Required when Authentication is 1, 2 or 3.
TenantIdstringEntra ID tenant id. Required for 2, optional for 1.
ClientIdstring2: client id of the app registration (required). 1: client id of a user-assigned managed identity (optional).
ClientSecretpasswordClient secret of the app registration. Required for 2.
SasTokenpasswordAccount or container SAS token with write permission (a leading ? is ignored). Required for 3.
ContainerNamestringTarget container.
CreateContainerbooleanfalsetrue creates the container (private) when it does not exist.
BlobNamestringTarget blob name including virtual folders, for example exports/daily.csv. Ending with / it is a folder and the record's name is appended (see Behaviour).
WriteModedropdown: 0 Block, 1 Append00: one block blob upload per record. 1: append blob, every record is appended.
OverwritebooleantrueBlock: true replaces an existing blob; false fails the upload (HTTP 409) when the blob exists.
AppendNewLinebooleantrueAppend: add a line break (\n) after each TextRecord.
ContentTypestringContent type of the blob, for example text/csv. Empty: the ContentType of the TextRecord, otherwise from the extension of the blob name (.csv, .json, .jsonl, .xml, .txt, .pdf, .zip, .gz, .parquet, images, ...), otherwise application/octet-stream.
AccessTierdropdown: 0 Default, 1 Hot, 2 Cool, 3 Cold, 4 Archive0Block: tier of the uploaded blob; 0 uses the account's default tier.
MetadatadictionaryName/value pairs stored as blob metadata (names must be valid C# identifiers).

Behaviour ​

  • The storage client is created at flow start; missing sign-in fields fail the start. 1 EntraId uses the default Azure credential (managed identity of the host, workload identity, environment variables or Azure CLI); the identity needs the Storage Blob Data Contributor role (it covers CreateContainer). With 3 SasToken, CreateContainer needs an account SAS that allows the container resource type.
  • Blob name: for a TextRecord, its Name replaces BlobName, or is appended when BlobName ends with /; without a Name, BlobName is used. For a ViaFileStream, BlobName is used; when it is empty the stream's Name is used, and when it ends with / the stream's Name is appended. An empty result fails the record.
  • With CreateContainer the container is created on the first write of the run if it is missing.
  • 0 Block: the content is uploaded with content type, metadata and tier. 1 Append: the append blob is created when missing (with content type and metadata), then the content is appended in blocks of up to 4 MB; following records and later runs append to the same blob.
  • Then Output is called with the input record. Other input types fail with a "not supported" error. Storage errors (missing container, authentication, existing blob with Overwrite false, append to an existing block blob) raise an error.

Notes ​

  • ViaFileStream input: the content of Stream is uploaded from its current position; the stream stays open (it belongs to the component that opened it).
  • Append blobs suit logs and JSON lines (.jsonl); appends of parallel writers interleave per record. An append blob holds at most 50,000 appends.
  • Archive blobs can't be read until they are rehydrated (set the tier back with Blob operation).
  • Store secrets as expression settings (=Secrets.AzureStorage).

Example ​

json
{ "Authentication": 1, "AccountUrl": "https://myaccount.blob.core.windows.net", "ContainerName": "exports", "CreateContainer": true, "BlobName": "daily/", "Metadata": { "source": "erp" } }

Timer → Sql query → Json serializer → Blob writer → Log (the TextRecord.Name of the serializer becomes the file in daily/)

Viaducta documentation