The open source OSR4RightsTools project needs user’s results to be persisted when a new deployment of the VM happens. Also we store user cookies in the file share for the same reason

Data is persisted to SQLAzure

Files are served using a url like

  • /downloads/90/results.html
  • /downloads/90/

  • /downloads/89/results.html
  • /downloads/89/results89.cs

And authentication/authorisation of these static files happens via downloads.cshtml

Blob Containers

This is classically how I’ve stored files.

Azure Files

Deploy File Share Create an Azure / SMB file share

  • Standard File Shares - HDD
  • Premium File Shares - SSD

GPv2 Accounts allow Azure files on HDD, and contain blob containers, queues and tables (standard)

FileStorage storage account are for SSD only (premium) costs for tiers

Redundancy - LRS - Locally redundant storage

Tier of File Share - Hot (will try cold) as cheaper than transaction-optimised. These are all in Standard HDD, so billing is based on usage rather than quota (which is what premium is)


# Create Storage / Azure file share 

# should only ever need to do once



# create resource group
az group create \
   --name ${rg} \
   --location ${region}

# create storage account

# standard LRS - not replicated
az storage account create \
    --resource-group $rg \
    --name $storageAccountName \
    --kind StorageV2 \
    --sku Standard_LRS

echo "sleeping to make sure storage account is created"
sleep 10


# create file share
az storage share-rm create \
    --resource-group $rg \
    --storage-account $storageAccountName \
    --name $shareName \
    --access-tier "Hot" \
    --quota 10 useful for seeing costs more detailed planning information.

alt text

So now we have an File Share, which can be accessed by Storage Explorer

Primary Storage account key is what we need for the password

Mount File Share

This is an SMB file share

  • will be nice as I can control all file security from an OS level
  • speed isn’t an issue (as smb can be slow)

Lets try on Ubuntu 20.04.3 LTS (GNU/Linux 5.8.0-1041-azure x86_64) which is this image on the 17th Sept 2021. Now using 22.04 on 13th Jun 2023


I should be able to use SMB 3.1.1 as we’re on 18.04.5 LTS+


This is what I use in production with password redacted which is long and finishes with ==

Primary Storage account key is what we need for the password, which can be found in Storage Explorer. (Copy Primary Key on vllstorageaccount)

sudo mkdir /mnt/osrshare

# allow all local users access to the share
sudo mount -t cifs // /mnt/osrshare -o username=osrstorageaccount,password=xxxxxxxxxg==,serverino,noperm

Survive a reboot

# vllshare.cred

# from .azcli script I copy the cred file
scp -o StrictHostKeyChecking=no ../secrets/vllshare.cred dave@${dnsname}

# on the file
sudo mv /home/dave/vllshare.cred /var/

sudo mkdir /mnt/vllshare

# sudo chown -R www-data:www-data /mnt/vllshare/cookie-keys

echo "// /mnt/vllshare cifs nofail,credentials=/var/vllshare.cred,serverino,nosharesock,actimeo=30" | sudo tee -a /etc/fstab > /dev/null

# reload fstab
sudo mount -a