Skip to content

Add azure-blob as a native document storage transport #2870

Closed

Description

@kengru-digito

Feature Description

Add a native Azure Blob Storage transport for document uploads and downloads, selectable via NEXT_PUBLIC_UPLOAD_TRANSPORT=azure-blob, in addition to the existing database and s3 transports.

Today the s3 transport uses @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner. Azure Blob Storage does not expose an S3-compatible API: its protocol differs in required headers (e.g. x-ms-blob-type: BlockBlob on direct PUTs), signed-URL scheme (SAS rather than S3 presigned URLs), and authentication. Pointing the s3 transport at an Azure endpoint does not work.

A native azure-blob transport closes that gap for self-hosters on Azure, without requiring an extra service in the upload path or replacing the managed cloud service.

Use Case

Self-hosters running Documenso on Azure want to store documents in their existing Azure Storage Account. Azure Blob Storage is the managed object storage that fits naturally into that stack.

Without a native transport, the options today are:

  1. Run an S3-to-Blob gateway in front of the upload path. Adds an extra service to operate, monitor, and pay for, and the gateway is on the critical path for every upload and download.
  2. Run MinIO as the object store inside the Azure deployment. Replaces the managed service with a self-operated one, which contradicts the reason for picking Azure in the first place.
  3. Stay on the database transport. Binary documents live in Postgres as base64, which inflates the database, complicates engine sizing and backups, and degrades over time as document volume grows.

A first-class azure-blob transport removes the need for any of these workarounds.

Proposed Solution

Refactor the storage layer into a small StorageProvider interface (five operations: three presigned URL signers, one server-side upload, one server-side delete). Move the existing S3 logic behind an S3Provider implementing the interface. Add AzureBlobProvider as a second implementation using the official @azure/storage-blob SDK.

A factory selects the provider at runtime based on NEXT_PUBLIC_UPLOAD_TRANSPORT. The public surface that the rest of the product imports stays the same: the five exported functions still live where they live today, now delegating to the active provider. Callers do not change.

New env vars, mirroring the existing S3 naming pattern:

  • NEXT_PRIVATE_UPLOAD_AZURE_ACCOUNT_NAME
  • NEXT_PRIVATE_UPLOAD_AZURE_ACCOUNT_KEY
  • NEXT_PRIVATE_UPLOAD_AZURE_CONTAINER
  • NEXT_PRIVATE_UPLOAD_AZURE_ENDPOINT (optional; for Azurite or custom endpoints)

Authentication starts with the Storage Account access key, mirroring how the s3 transport keeps credentials in env vars. Managed Identity with user delegation SAS fits cleanly as a follow-up over the same provider when the deployment is on Azure App Service.

Client-side put-file.ts branches by transport to add the x-ms-blob-type: BlockBlob header on the browser PUT for azure-blob, without affecting the s3 path.

s3 and database transports preserve current behavior with no migration required. DocumentDataType.S3_PATH is reused for blobs stored in Azure (semantically "key in object storage"), avoiding a Prisma migration.

Alternatives (optional)

No response

Additional Context

I have a working implementation running locally against Azurite, end-to-end on all five storage operations, and verified the existing s3 transport still works through the refactored abstraction.

I discussed the direction with the Documenso team via Slack and got the go-ahead to contribute upstream. Happy to coordinate on scope or naming before opening the PR.

I'm working on this and will open the PR against this issue.

Please check the boxes that apply to this feature request.

  • I have searched the existing feature requests to make sure this is not a duplicate.
  • I have provided a detailed description of the requested feature.
  • I have explained the use case or scenario for this feature.
  • I have included any relevant technical details or design suggestions.
  • I understand that this is a suggestion and that there is no guarantee of implementation.
  • I want to work on creating a PR for this issue if approved

Activity

  1. added
    status: triage
    on May 26, 2026
  2. github-actions commented on May 26, 2026

    @github-actions
    Contributor

    Thank you for opening your first issue and for being a part of the open signing revolution!

    One of our team members will review it and get back to you as soon as it possible 💚

    Meanwhile, please feel free to hop into our community in Discord

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

status: triage

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions