Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Azure icon
Labs

Using Azure Files with a Linux VM

Azure file shares provide a simple and reliable way to store data in a typical directory hierarchy. Moreover, file share data can be accessed using the widely supported Samba protocol. This enables you to mount Azure file shares to a virtual machine and easily interact with the files from your VM. In this lab, you will have the opportunity to mount an Azure file share to a Linux VM. By the time you have completed the lab, you will be able to read and write to an Azure file share from your Linux VM.

Azure icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 04, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Create a Secure Credentials File to Store Credentials for the Samba Share
    1. Create a file that will contain the Samba credentials for the storage account. Note that for the file name, you should enter your unique service account name:

      sudo mkdir -p /etc/smbcredentials
      
      sudo vi /etc/smbcredentials/<STORAGE_ACCOUNT_NAME>.cred
      
    2. Store the Samba user (storage account name) and password (storage account key) in the file. Input your unique storage account name and key, which you can find via Azure portal.

    3. The file should look like this:

      username=<STORAGE_ACCOUNT_NAME>
      password=<STORAGE_ACCOUNT_KEY>
      
    4. Set permissions on the credential file so that only root can read it:

      sudo chmod 600 /etc/smbcredentials/<STORAGE_ACCOUNT_NAME>.cred
      
  2. Challenge

    Mount the File Share to the Linux VM
    1. Create a directory for the mount:

      sudo mkdir -p /mnt/sattrecords
      
    2. Edit the fstab file:

      sudo vi /etc/fstab
      
    3. At the end of the file, add a line to automatically mount the Azure file share whenever the server starts up:

      //<STORAGE_ACCOUNT_NAME>.file.core.windows.net/records /mnt/sattrecords cifs nofail,vers=3.0,credentials=/etc/smbcredentials/<STORAGE_ACCOUNT_NAME>.cred,serverino
      
    4. Mount the file share by mounting all filesystems in fstab.

      sudo mount -a
      
    5. Browse the mounted directory. You should see files there that are stored in the Azure file share:

      cd /mnt/sattrecords
      
      ls -la
      
    6. Test your ability to write to the Azure file share by creating a test file:

      sudo vi test_file.txt
      
    7. Write some text to your test file and save it. If you wish, you can navigate to the file share in the Azure portal and view your new file there.

About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight