How to implement azure file share in your existing system

How to implement azure file share in your existing system

Dharmishtha Thesiya

14 Sep 2023

10 MINUTES READ

Introduction

In today's data-driven world, businesses rely heavily on data storage and sharing to ensure efficient operations and collaboration. Microsoft Azure provides a range of cloud storage solutions, one of which is Azure File Share, a fully managed file share service in the Azure cloud. If you're looking to enhance your existing system's storage capabilities, integrating Azure File Share could be a strategic move. In this blog post, we will explore how to implement Azure File Share into your existing system.

Assess your storage needs

Before diving into the technical implementation, it's crucial to evaluate your storage requirements. Identify what types of files you need to store, how frequently they are accessed, and the expected growth rate of your data. Understanding your needs will help you choose the right Azure File Share configuration and size.

Create an azure storage account

To use Azure File Share, you'll need an Azure Storage Account. If you don't have one, follow these steps to create it:

  • Log in to the Azure portal.
  • Click on "Create a resource."
  • Search for "Storage account" and select it.
  • Configure the necessary settings (region, performance, etc.), and click "Review + create."

Create an azure file share

Once your Azure Storage Account is set up, create an Azure File Share:

  • Navigate to your newly created Storage Account.
  • In the left-hand menu, under "File service," click "File shares."
  • Click the "+ File share" button.
  • Provide a name for your file share and configure the settings, such as quota and access control.
Create an Azure File Share

Connect to azure file shares

Now that you have an Azure File Share, you'll need to connect to it from your existing system. There are several methods for connecting, including:

SMB protocol: You can access Azure File Share using standard Server Message Block (SMB) protocol. This method is suitable for Windows-based systems. Configure the appropriate credentials and access the share as you would with any network drive.

Rest API: If your system operates in a non-Windows environment, you can use the Azure File Storage REST API for programmatic access.

Implement data transfer

With the connection established, it's time to start transferring your data to Azure File Share. Depending on the size and volume of data, you may use tools like AzCopy, Azure Storage Explorer, or create custom scripts.

Azure Storage option is good to transfer files speedily when your files is large download your olds file from server. Here is document link how to set access your storage in local system Storage How To Use Files Windows.

Mount the storage to your app services

1. In azure, you can mount the storage account to your app service using the "azure files" feature.

Now Navigate same table under Path Mapping > Mount storage > New Azure Storage Mount Add Name, Configuration


    Option > select Basic >Select Your Storage Container > Mount Path > Add your mount folder path like
    : /mounts/images 
Mount the Storage to your App Services

here what you add in mount path you can see that folders create in your service drive and your storage containers images synced.

storage containers images synced
2. Now here you can access your image with same path like your web app deployed you need to add virtual applications and directories with new mounted path like

Virtual Path : images
Physical Path : /mounts/images

So now you can access your files direct like

{your app name}.azurewebsites.net/images
Now here you can access your image with same path like your web app deployed you need to add Virtual applications and directories with new mounted path like

Another option you need to set up code base in your application Startup.cs > Configure Method


        if (!env.IsDevelopment())
        {
            string folder_name = Configuration["ImageStorageConfig:fileShareDirectory"]; //Add your app setting folder name you want to get images
            app.UseStaticFiles(new StaticFileOptions()
            {
                FileProvider = new PhysicalFileProvider("C:\\{your mount folder path}\\"+ folder_name),
                RequestPath = "/images" // you can give what name you access your images like {your app name}.azurewebsites.net/images
            });
        }
              
3. Make sure your web app and your storage have a same region and same virtual network

    Go to web APP > Networking > Outbound Traffic > VNet integration Add if VN is not here and Select Same
    as Storage Containers
        
Make sure your Web APP and your storage have a same region and same Virtual Network

Configure backup and security

Azure File Share offers built-in features for data backup and security. Configure backup policies and encryption to ensure data durability and confidentiality. Implement access control through Azure Active Directory to manage permissions efficiently.

Monitor and optimizes

Regularly monitor your Azure File Share's performance and usage using Azure Monitor and Azure Storage Explorer. Adjust configurations and scaling as needed to optimize cost and performance.

Conclusions

Integrating Azure File Share into your existing system can significantly enhance your storage capabilities while providing the scalability and reliability of the Azure cloud. Assess your needs, create the necessary Azure resources, establish connections, and implement data transfer and security measures to fully leverage the benefits of Azure File Share. With the right setup, you'll be better equipped to handle your organization's growing storage requirements efficiently and securely.

Looking for exceptional .NET development services? Your search ends here with Techvoot Solutions. Our team consists of highly skilled and experienced .NET developers who possess deep expertise in creating functional and scalable websites and applications to drive your business expansion. Don't wait any longer hire our .NET developers today and take your business to the next level.


Dharmishtha Thesiya
Dharmishtha Thesiya

.Net Developer at Techvoot solutions

Dharmishtha Thesiya is a proficient .NET developer with a strong command of the technology. She possesses a keen eye for detail and is dedicated to delivering high-quality software solutions.

Linkedin
Hire Skilled Developer

*Please fill all the required fields

Get our Newsletter

Customized solutions for your projects

*Please fill all the required fields