Blob Storage: Configuring Immutable Backups with TrueNas and Azure — Managing Time-Based Retention

AnthonyLiwen-4936 20 Reputation points
2026-10-20T13:36:56.48+00:00

I am attempting to configure Azure Blob Storage as the destination for SQL backup files written by TrueNAS Cloud Sync, with the goal of keeping these backups undeletable for 60 days. I tried using a time-based retention and that works for incremental SQL backups, but I'm facing issues where the copy process fails when copying full SQL backups. It fails because of the immutable time-based retention policy on the blobs

Azure Blob Storage
Azure Blob Storage

An Azure service that stores unstructured data in the cloud as blobs.


2 answers

Sort by: Most helpful
  1. Allan Solomon Mejia 10,545 Reputation points
    2026-10-21T20:12:37.4+00:00

    Hi @AnthonyLiwen-4936

    Thanks for clarifying how TrueNAS Cloud Sync handles the uploads. That additional information helps narrow down the issue considerably.

    Since your backup filenames are unique and Azure returns BlobImmutableDueToPolicy, I agree that filename reuse is unlikely to be the cause.

    The important detail is that TrueNAS uses rclone to perform chunked block-blob uploads for larger files, while your destination container has an active container-level time-based retention policy.

    1. Why the full backups may fail

    The container-level immutability allows new blobs to be created but prevents modification or overwriting of existing protected blobs.

    For larger uploads, rclone may use Azure Blob Storage's block-upload operations, including Put Block and Put Block List.

    The failure may occur when rclone attempts to finalize the block blob or perform a subsequent operation that Azure considers a modification of immutable content.

    However, we should confirm the specific failed REST operation before concluding that Put Block List itself is unsupported for your scenario.

    2. Will switching from SYNC to COPY resolve it?

    Switching to COPY is worth testing because it avoids the destination-deletion behavior associated with synchronization.

    However, COPY doesn't necessarily change the underlying block-upload mechanism used by rclone.

    Therefore, it may prevent deletion-related errors but might not resolve BlobImmutableDueToPolicy during large-file uploads.

    3. Recommended controlled test

    I suggest testing with a separate, non-production container before changing the existing retention policy.

    Create a test container with the same container-level immutability configuration.

    Upload a small backup file using TrueNAS Cloud Sync COPY.

    Upload a larger file that triggers chunked block-blob uploads.

    Compare the results and capture the exact Azure Storage error for the failed operation.

    If the smaller upload succeeds but the larger upload fails, that would provide useful evidence of a compatibility issue involving the upload sequence.

    For further confirmation, Azure Storage diagnostic logs can identify the failed REST operation, response status, and storage error code.

    4. Alternative approach for immutable SQL backups

    Since your SQL backup files are completed before upload and don't require subsequent modification, you could also evaluate a two-stage workflow:

    TrueNAS → Azure Blob staging container → Immutable backup container

    The staging container would allow TrueNAS to complete its upload operations without an active immutability restriction.

    After successful upload, a separate Azure-supported copy operation could place the completed backup into the immutable destination.

    This would need to be tested with your storage account configuration, particularly the copy operation's behavior under container-level immutability.

    It would also require validating that the destination backup is complete and readable before deleting the staging copy.

    5. About protected append writes

    The allowProtectedAppendWritesAll option for certain block-blob append scenarios.

    However, this setting doesn't universally permit modifications to immutable block blobs, and it isn't a guaranteed solution for rclone's upload workflow.

    I don't recommend enabling it without first confirming that it supports the failed operation.

    References:


    Help make this community better for everyone: If this answer helped or resolved your issue, please accept it or upvote it. Thank you.

    Was this answer helpful?

    0 comments No comments

  2. Hemant Bharadwaj 0 Reputation points Microsoft Employee
    2026-10-20T21:24:29.6233333+00:00

    This behavior is consistent with TrueNAS attempting to replace, rename or delete a blob that is already protected by the time-based immutability policy.

    Once the policy applies, Azure Blob Storage must reject operations that modify or delete protected content. A full backup commonly reuses the same destination filename, while incremental backups often create new files; that difference would explain why one workflow succeeds and the other fails.

    Recommended approach:

    1. Configure the SQL backup process to produce a unique, timestamped name for every full backup.
    2. Ensure TrueNAS uploads only completed backup files rather than files still being written.
    3. Configure Cloud Sync so it creates a new blob and does not overwrite, rename or delete the previous destination blob.
    4. Check the TrueNAS log for the exact Azure response, especially HTTP 409 or errors such as BlobImmutableDueToPolicy.
    5. Test both backup and restore before locking the policy.

    If the workflow must reuse a logical filename, evaluate version-level immutability with blob versioning. A new version may be created while older protected versions remain immutable, but this works only if the operations issued by TrueNAS are supported under the selected policy. It will not make an overwrite/delete-style synchronization operation automatically compatible.

    Another design is to upload to a staging container and copy each completed file—under a unique name—to the immutable destination. Note that the staging period is not WORM-protected, so this is appropriate only if that gap meets the recovery and compliance requirements.

    Also remember that a locked retention policy cannot be shortened or removed. Test with an unlocked policy and representative full-backup files first.

    References:

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.