Search code examples
azuredockerazure-web-app-servicestorageqdrant

How to save data from qdrant to azure blob storage/file share storage?


I have a qdrant that is deployed in a docker container in the azure app service. Data from qdrant collections is saved in the docker container itself - this is the main problem, because when the application is restarted, all the data that was in the container disappears. I need to save data in a separate storage, preferably a blob/file share. I'm not considering the possibility of deploying qdrant in Kubernetes and container instance

I tried to specify the path to save the data in the azure application configurations, different paths where azure saves the data, but nothing came of it. I also tried to do this using the qdrant docker configuration, but nothing came of it either.


Solution

  • To save data from Qdrant to Azure Blob Storage or File Share Storage, follow these steps:

    1. If you are using Azure Container Service, start by creating a storage account and then create a file share within that storage account.
    2. Use the following command to save the STORAGE_KEY:
    STORAGE_KEY=$(az storage account keys list --resource-group <resource_group_name> --account-name <storage_account_name>  --query "[0].value" --output tsv)
    
    1. Next, run the following command to create the Qdrant container, which will expose port 6333 and write to the Azure file share:
    az container create --resource-group <resource_group_name> \
        --name qdrant --image qdrant/qdrant --dns-name-label qdrant \
        --ports 6333 --azure-file-volume-account-name <storage_account_name> \
        --azure-file-volume-account-key $STORAGE_KEY \
        --azure-file-volume-share-name <file_share_name> \
        --azure-file-volume-mount-path /qdrant/storage
    

    This will save data from Qdrant to Azure File Share Storage.