Azure File Shares as Container Volume Mounts

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ส.ค. 2024
  • Azure File Shares are a great place to persist data for your App Service containers, but how do you set it up? In this video, we'll discuss why you need to use volume mounts to safely store files outside of a Docker container and walk through how to use an Azure Storage File Share as a volume mount within an Azure App Service.
    ------------ CHAPTERS ------------
    00:00 - Put it in a container...
    00:19 - Welcome
    00:29 - Why volume mounts are important
    01:35 - Example use case
    02:12 - Prerequisites
    02:27 - Configuring Azure Storage
    03:08 - Configuring the Azure App Service
    03:52 - Updating the docker-compose.yml
    04:35 - Wrap Up
    Don't forget to comment, like and subscribe 🚀
    💬 JOIN US ON DISCORD
    bbb.dev/discord
    🧑‍💻 LET'S CONNECT ON SOCIAL
    Twitter: / michaeljolley
    Blog: baldbeardedbuilder.com
    TikTok: / baldbeardedbuilder
    Instagram: / baldbeardedbuilder
    Twitch: twitch.com/baldbeardedbuilder
    #azure #azurestorage #containers

ความคิดเห็น • 67

  • @BaldBeardedBuilder
    @BaldBeardedBuilder  3 ปีที่แล้ว +3

    I love using Docker containers and Azure makes it pretty simple to get started. Are you using containers in your Azure App Services? How are you handling files that need to be saved/read by your application?

  • @SuperGeneralCrazy
    @SuperGeneralCrazy 3 ปีที่แล้ว +5

    Here I was scratching my head as to how this file share system works, thinking it was rocket science.. And you, my man, have saved me after hours and hours of being confused. Thank so much! ❤

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว

      Thanks! Glad it helped.

    • @chunhingyap
      @chunhingyap ปีที่แล้ว

      I am little confuse. in dockerfile, I just put volume mount _dir and build the docker. And, in web app mapping, I specify file share container and mount_dir. Your video is for docker-compose, and the logic of the path mapping you showed is different.

  • @B1TCH35K1LL3R
    @B1TCH35K1LL3R ปีที่แล้ว +1

    concise and excellently explained... thank you!

  • @bretthenning9531
    @bretthenning9531 2 ปีที่แล้ว

    Love it, saved me too. Thanks a million Michael!

  • @cdfcloud
    @cdfcloud ปีที่แล้ว

    I was looking for this solution long time
    Thank you so much for solving it
    Keep continuing the same

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  11 หลายเดือนก่อน +1

      Glad it helped! All the best to you

  • @MiguelAGV-mc3iw
    @MiguelAGV-mc3iw 3 ปีที่แล้ว +2

    you have saved me the day!

  • @alitswq
    @alitswq 3 ปีที่แล้ว

    Amazing, Thanks for the nice tutorial

  • @sznapi123
    @sznapi123 2 ปีที่แล้ว

    Very helpful, thanks!

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  11 หลายเดือนก่อน

      Glad it helped! Thanks for letting me know!

  • @Smartst3r
    @Smartst3r 7 หลายเดือนก่อน

    Thank you!

  • @lecadou
    @lecadou ปีที่แล้ว +3

    This docker compose file is not complete. You named the volume and the target directory, but you did not show the part where File Share is mapped to the container.

  • @RawCoding
    @RawCoding 5 วันที่ผ่านมา

    great video

  • @judgewest2000
    @judgewest2000 10 หลายเดือนก่อน

    In terms of saving data into permanent storage my route has always been to save them directly to blob storage natively, whether I'm running it in an Azure container, locally, or just running the app natively on my own computer with no docker I always do that.
    I would guess the benefit of your approach is (theoretically at least) you can shift your container from Azure to AWS or GCP or some other docker cloud provider and work with whatever storage mechanism they provide.

  • @CloudWithUgur
    @CloudWithUgur 2 ปีที่แล้ว

    thank you. and i mean it.

  • @ghoufranghazaly4575
    @ghoufranghazaly4575 ปีที่แล้ว

    how can I use azure share file as bind mount for docker container ?

  • @LostOnTheLine
    @LostOnTheLine ปีที่แล้ว +1

    You made a video about how to use Azure File Shares in a container... Then skipped over the how to use Azure File Shares part.
    I just need to add 4 files that total less than 500KB combined into a Docker container. Why is this so hard?

  • @vakarami
    @vakarami 3 ปีที่แล้ว

    Thanks for your unique tutorial, btw I try to use it to persist mongodb data into but mongodb can't access the directory that I specified and it writes data in the root of storage
    here is my volume config:
    volumes:
    - data-db:/data/db
    that data-db is a path mapping that refers to a folder name data-db.
    can u see where did I miss?

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว +1

      I don't think you can use it for this. I'd suggest using CosmosDb or Mongos DbaaS. You normally don't want to run databases in a container.

  • @YogiHosting
    @YogiHosting 3 ปีที่แล้ว +1

    Nice tutorial, after doing volumen mount how can I now enter insider the container and check whether the files are available inside the directory of the container? I tried doing with ftp but i could not find any thing there.

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว +1

      I _believe_ Azure provides a way to use bash or sh inside the container. That may be inside the Configuration blade of the app service.

    • @mikesurel5040
      @mikesurel5040 2 ปีที่แล้ว

      @@BaldBeardedBuilder you can SSH to the container. IF you are shipping your own containers you need to provide make sure your container has SSH installed and running and the password for root on the container is the well known value Docker! in order for SSH from the azure portal to work. There are a variety of tutorials on how to do this, but at the end of the day the only part that ends up being tricky at all is making sure SSH in installed correctly for your distro. I went through many tutorials, none of them were quite right. On the plus side you can test all of that locally before shipping your container and calling it 'done'.

  • @Auxanuite
    @Auxanuite 3 ปีที่แล้ว

    Great video for starters , can you incorporate secrets within the container that has volume mounts

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว

      Absolutely. Providing secrets to the container in the form of environment variables is totally possible. Mounts aren't required. In the configuration settings of the app service, just add them in the configuration.

  • @cabarini
    @cabarini 3 หลายเดือนก่อน

    I did not understand how to create the yml file. Could you give us some step-by-step information. Newbe here!

  • @samanthaletourneau9709
    @samanthaletourneau9709 3 ปีที่แล้ว

    Is it possible to mount the share file in docker-compose while using Azure Container Instances and not App Service ?

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว +1

      I'm not certain you can with a docker-compose file. I know you can use the Azure SDK or CLI. In fact, I did it with a recent project. I'll paste a link to the actual code that creates the container instance with a volume mount to Azure Storage below.
      github.com/builders-club/onlythemes/blob/b4212fe6cd56a7c8ab30c8adc70ac42efb746063/backend/api/Azure/azureCI.ts#L32

  • @nanikhil3
    @nanikhil3 ปีที่แล้ว

    We are using linux app service in azure portal for our PHP project. We want to use Azure storage blob to save pdfs. We want to move all our existing pdfs that are inside the project folder in that app service into the azure storage file share. Can you tell us how do we do that? Is there any provision to directly move the app service files into azure storage

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  11 หลายเดือนก่อน

      Sorry for the delay. The short answer (which I'm sure you already found) was no. You'd have to manage that process manually or write something to copy them.

  • @prajvalaraghu3267
    @prajvalaraghu3267 3 ปีที่แล้ว

    Can i use Azure File Shares as Container Volume Mounts in Function app am not able to see the path settings

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว

      I don't think you can run containers in a function app, which would make it impossible to mount anything to it. You can however access all Azure storage from functions. That may be what you want to do.

  • @thomassachinjohn
    @thomassachinjohn 3 ปีที่แล้ว

    I have issues mounting files for my WordPress site. It's not storing data to file share even path is specified

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  2 ปีที่แล้ว

      Ouch! I've not used WordPress with Azure before so I'm not sure I have the answers. Sorry!

  • @alexandrevtukh7905
    @alexandrevtukh7905 3 ปีที่แล้ว

    I do not see an option to '+ New Azure Storage Mount' as well. How can I find it?

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว +1

      Did you have the Path Options tab under the Configuration blade? This only applies to App Services, not Functions or container instances.

    • @alexandrevtukh7905
      @alexandrevtukh7905 3 ปีที่แล้ว

      Thank you. I found it. It's available only for container deployment.

  • @mohammadlatta3770
    @mohammadlatta3770 3 ปีที่แล้ว +1

    is there any way to do that without docker compose?

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว +1

      Yes. I believe if you're just running one container then you don't need the compose file. In setting up the app service, just pull the image from whatever container registry you need and enter the mount information as I mentioned.

    • @rablar_devops
      @rablar_devops ปีที่แล้ว

      @@BaldBeardedBuilder but how would you map the container's path to that file share? it's confusing, can you elaborate plz?

  • @monuhuria
    @monuhuria 3 ปีที่แล้ว

    hey @Bald.Bearded.Builder My case is as:
    using app service and on that deploying an docker image from public docker hub option.
    now i don't want any docker compose or dockerfile as i am directly using grafana/grafana:latest.
    my problm is i want to install plugins and wants to add a volume ..how can i achieve that..
    NOTE: things are already in prodcution and i am just rying to understand the things as no enginner is there to help me out.

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว +1

      You can still use grafana/grafana:latest with a docker compose file. In fact, you'll need to if you want to mount to Azure storage

    • @monuhuria
      @monuhuria 3 ปีที่แล้ว

      @@BaldBeardedBuilder Thank you 😊. I have now completed the task without using manual dockerfile or compose file. I have utilised file storage and put the plug-ins and dB detail there so everything is working smoothly now.

  • @NBUltra187
    @NBUltra187 3 ปีที่แล้ว

    Has something changed? In the path mappings, I do not see an option to '+ New Azure Storage Mount'. How is it done now?
    nevermind, sorrry

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว

      Glad you found it

    • @NBUltra187
      @NBUltra187 3 ปีที่แล้ว

      @@BaldBeardedBuilder thank you for replying. although, i couldn't apply what you were sharing in this video...it was quite informative and i learned something. i would like to know, if there is a way to use docker compose and mount a volume to the $(Build.ArtifactStagingDirectory) in an Azure pipeline? I thought maybe I could use the method shown in this video but I could not. In the docker cli...i can mount it via the argument to the command run (ie. -v $(Build.ArtifactStagingDirectory):/opt/mylinux/files). i'm pretty sure it's possible...just not sure how. again, thanks for the video

  • @harikrishna6944
    @harikrishna6944 2 ปีที่แล้ว

    can we consider azure file share a container?

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  2 ปีที่แล้ว +1

      No. Azure File Share is a service. A container would run separately. But you can mount a file share folder to a container as discussed in the video.

  • @HandleYourHandle
    @HandleYourHandle 2 ปีที่แล้ว

    Is it possible to mount on a windows image?

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  2 ปีที่แล้ว

      Good question. I've not used a WIndows image in Azure, but it should work the same way.

  • @architdhiman7713
    @architdhiman7713 2 หลายเดือนก่อน

    Has some things changed? I can see the documentation that docker-compose is not supported for bring your own storage with azure app service

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  2 หลายเดือนก่อน

      That's possible. This video is 3 years old. However, I wouldn't consider using Azure file storage "bring your own storage."

    • @architdhiman7713
      @architdhiman7713 2 หลายเดือนก่อน

      I'm not able to send the link ig yt is blocking that

    • @architdhiman7713
      @architdhiman7713 2 หลายเดือนก่อน

      I've sent the link on Twitter

  • @tanishqalal1074
    @tanishqalal1074 3 ปีที่แล้ว

    Is there any way to this for blob files?

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว

      There wasn’t the last time I checked.

    • @tanishqalal1074
      @tanishqalal1074 3 ปีที่แล้ว +1

      @@BaldBeardedBuilder thank you so much for replying.

  • @eumesmo5306
    @eumesmo5306 3 ปีที่แล้ว

    really, thank you, the documentation on this is so shitty, it is good to have a nice video turoial explaining what should have been clearer in the docs S2

    • @BaldBeardedBuilder
      @BaldBeardedBuilder  3 ปีที่แล้ว

      Glad it helped!

    • @eumesmo5306
      @eumesmo5306 3 ปีที่แล้ว +1

      @@BaldBeardedBuilder only one point to mention, the "Mount path" actually is the path inside the container that will be mapped to the azurefilestorage, and not the folder on the azurefilestorage to be used, só it is actually the sabe that defining a "volume: - share:mount/path/on/container" on the dockerfile.
      another point is that, instead of configuring that way with file mapping you could only put it inside the docker-compose.yml. Example of configuring 3 volumes:
      volumes:
      redis_store:
      driver: azure_file
      driver_opts:
      share_name: prod-volume-redis-store
      storage_account_name: myfilestorageaccount
      public:
      driver: azure_file
      driver_opts:
      share_name: prod-volume-public
      storage_account_name: myfilestorageaccount
      files:
      driver: azure_file
      driver_opts:
      share_name: prod-volume-files
      storage_account_name: myfilestorageaccount

  • @vliopard
    @vliopard ปีที่แล้ว

    When I saw "File Share as Container" I tought the video is related to use dbutils.fs.mount(source="wasbs://", mount_point="/mnt/azure_ml", extra_configs=) with fileshare. But this is not the right video.