Backup to a folder in Azure Blob storage

Hello everyone,

I want to use Azure Blob storge as my backup destination.
I don’t want to create a ton of containers, so I would prefer within 1 container to backup to dfferent folders.

However, I have no clue how to do that. When I use containername/folder as “container name”, the backup will still back up to the root folder.

Is that even possible with Duplicati?

There was a similar post years ago, but without any solution:
Backing up to Azure Blob - Duplicati

Thank you and best regards

In the backend config, there is only support for a container name.
The azure blob storage does not seem to directly support folders (the equivalent would be containers). But, you can add slashes in blob names (equivalent of filenames) to add a virtual hierarchy (this is from a brief look at the documentation, I am not familiar with it myself).

What you can try, is using the advanced option --prefix=folder/duplicati. Make sure that every prefix is different. Do a test backup and restore, and if you can, look at the container in azure to see if everything is as expected.

If the slash does not work, use different prefixes without folders. However, depending on the internal implementation, it might be required to list the contents of the entire container for every backup. If that is the case, you might see slowdowns if many backups share the same container.


Amazing, with the --prefix=folder/ it worked perfectly!
Thank you so much!

1 Like

This is a creative use of prefix:

A string used to prefix the filenames of the remote volumes, can be used to store multiple backups in the same remote folder.

for storage that doesn’t have folders, but where tools can fake a virtual hierarchy from slash in names.

Blob Names

By default, the Blob service is based on a flat storage scheme, not a hierarchical scheme. However, you may specify a character or string delimiter within a blob name to create a virtual hierarchy.

The benefits of a hierarchical namespace says how some Azure system have it, but maybe not yours?

Some Duplicati messages that normally show just the file name might include the folder, as it’s in a file name as far as Duplicati is concerned. Maybe all will work, maybe not. Watch out for performance loss mentioned earlier. Duplicati possibly will have to list the whole container to search for the relevant files.

Add support for B2 ‘prefix’ API parameter when listing files #3803 was a change for Backblaze, which supports a similar virtual hierarchy and can limit a list to a virtual folder. Unsure if we do it for Azure.

If this creative workaround works, nice, but please test it well. I don’t know if was originally envisioned.