Create storage extra volume based on the logged-in user name

Hello,
I would like to create volume mount (to Azure Share File) based on the logged-in user
After spending some time with official documentation and with help of this issue I understood that it’s not correct :slight_smile:
so I ended up with the following setup which worked great:

singleUser:
  storage:
    extraVolumes:
      - name: jupyterhub-shared
        azureFile:
          shareName: scripts
          secretName: azure-secret
          readOnly: false
    extraVolumeMounts:
      - name: jupyterhub-shared
        mountPath: /home/jovyan/scripts

The problem is that I need each user has his own Shared Files, for example user1-scripts, i can create file share ahead, but how it possible to point out to this share from the single user config?
for example:

singleUser:
  storage:
    extraVolumes:
      - name: jupyterhub-shared
        azureFile:
          shareName: {user}-scripts
          secretName: azure-secret
          readOnly: false
    extraVolumeMounts:
      - name: jupyterhub-shared
        mountPath: /home/jovyan/scripts

Any help/suggestions will be highly appreciated!
Yan

{username} should expand to the user’s (escaped) name. Check the kubespawner docs which lists the template variables available.

Perfect! Thank you so much!

Hi, I’m trying to achieve the same as you, but your config example doesn’t work for me. Would you mind sharing your setup?

Best regards
Roy