In this guide, we shall look at what is required to deploy legacy app to Azure file share and set up all the necessary azure services that will make it possible to deploy legacy apps to Azure file share. A legacy app is a piece of software that has been around for a while but is still in use today despite newer technologies and systems being available. An older programming language, operating system, or hardware platform is typically used to create a legacy app, which may not be compatible with more recent designs. Deploying using file share is a good option because file share is a simple and versatile way to store and retrieve files in the cloud that is straightforward to set up in Azure.
Also, because legacy apps frequently rely on file-based storage, file share offers these apps a well-known and suitable storage alternative. Other similar articles can be found here: How to Control Cloud Cost Using Azure VM and How to create Confidential VMs in Azure also Ways to Run PowerShell remotely on Azure VMs and How to work with Azure Cognitive Service also How to use Azure Compute Gallery and Azure Hybrid Use Cases and Benefits.
Deploy Azure Fileshare: The Processes Involved in the Deployment
To deploy legacy app Azure fileshare, several steps must be taken: the application and its dependencies must be evaluated; the fileshare must be set up and configured; files must be copied to the fileshare; the application must be tested and validated; the application must be deployed to production; and the application and fileshare must be monitored and maintained. However, we shall look at the processes in detail with the steps below:
1. Assess your App before deploying Legacy App to Azure Fileshare
To deploy a legacy program utilizing fileshare, it is crucial to examine the application’s design and potential difficulties, test the application in a staging environment, check file permissions, prepare for scalability, and plan for backups and disaster recovery. By following these steps, you can ensure a smooth and successful deployment process. Here are some exciting articles: How to create and configure a Shared Folder on Windows Server, “Network File System: How to install NFS Server on Windows Server“, and Generation 2 VM: How to set up a Hyper-V Virtual Machine.
2. Create an Azure Storage Account
You must set up a premium performance tier Azure storage account. NFS 4.1 shares are currently only accessible as premium file shares.
a)Enter your credentials in the Azure portal @ https://portal.azure.com.
b) in the search resource, service, and document field, type storage account
c) From the search options, select the storage accounts option as shown below
d) Click on either of the create buttons
d) Fill in your project details, this would usually include your subscription and your resource group
Note: This is actually the most important step
e)Instance details – for the instance details, give your storage account a name and select the region that you wish to host your workload. However, for For solid-state SSDs to store your data, choose the Premium performance tier (SSD). Choose File sharing from the list of Premium account types as file sharing only works with premium.
Review to begin validation
f) Click on the review button
g) click on the create button to create the storage account take note of the items pointed at with the arrow before you create
h) Click on go resource to access the storage account
I) view the created account
Deploy Legacy App to Azure Fileshare
Please see How to remove Remote Desktop Services Role on Windows Server, and how to fix Git is not recognized as an internal or external command
3. Create a Linux Virtual Machine that will host the Legacy App in Azure File Share
Before proceeding with these steps, these articles might be interesting to you: Why does the legacy PXE not does work on Generation 2 VM, How to set up a VM via PXE boot on a Generation 1 VM, How to create and configure a Shared Folder on Windows Server, and How to create and configure a Shared Folder on Windows Server.
Creating a Linux VM is standard you can check this link for other methods of creating a Virtual Machine How to Create a Linux Virtual Machine Via Azure CLI. Let’s quickly create one with the steps below.
a) search and select a virtual machine from the search options
b) fill in the project & instance details
c) Add administrative account and inbound port rules
Note: Important part
d) Create a Virtual Network
f) click on the review and create button to begin validation
g) Click on the create button to begin deployment
click create to begin
h) view the running VM
4. Add file share to the storage account created in step 2
a) Go to home and select the storage accounts created earlier from recent resource
b) create a file share and assign it a throughput of 10GB
5. Create a private endpoint for accessing the file share
create a private endpoint for your storage account. As a result, your storage account receives a private IP address from your virtual network’s address space.
a) select the file share ( legacyfileshare) created in step No.4 A dialog box stating Connect to this NFS share from Linux should appear. Review options can be found under Network configuration.
b) Click Establish a private endpoint next.
Setup private endpoint
c) Enter project & instance detail for the endpoint
d) Resource: confirm that you are connecting to the right resource, and make sure that the target sub-resource brings out file
e) Virtual Network: Select the virtual network connected to your VM under Networking, leaving the preset subnet alone. Keep the checkbox next to Dynamically assign IP address checked under Private IP configuration. Select DNS Next.
f) DNS: To integrate with a private DNS zone, select Yes. Select Next: Tags after ensuring that the appropriate membership and resource group are chosen.
g) Tag: You can use tags to classify your resources; for example, you could give all of your testing resources the name Environment and the value Test but in our example, we have chosen to give the name techdirectarchive and value as legacy app-migration. If necessary, enter name/value combinations before choosing Next: Review + Create.
Review to Validate
Azure makes an effort to confirm the private endpoint. After confirmation is finished, choose to Create. An alert letting you know that distribution is happening will appear. You ought to see a notice that the deployment is finished after a short while.
Deploy the endpoint by clicking the create button
6. Turn off secure Transfer for the file share
With the NFS protocol, Azure Files does not currently support encryption-in-transit and instead depends on network-level security. As a result, you must turn off secure transfer.
- Go to Home
- Search for storage accounts and look for the storage account you created for the project
- Select file share from the storage account pane under the data storage section
- Select the NFS file share that you created. Under the Secure transfer setting, select Change setting.
Next, click on the disabled button
7. Connect to the VM created in step 3.
You can do this by clicking on the connect button on the virtual machine’s overview page and selecting connect. copy item number 4 of the ssh tab
ssh -i <private key path> email@example.com
since we are connecting using a password and not a private key the command below will just do
8. Mount the NFS share
We will mount the NFS fileshare created in an earlier step on the Linux client that we connected to in step 7
- Go to Home and look for the storage account you created earlier
- Under the Data storage option select Fileshare
- Select the file NFS file share you created earlier
- click on connect from Linux
- Copy all the commands and past in the running Linux terminal from step 7
The sample code to input in the terminal window is below
sudo apt-get -y update sudo apt-get install nfs-common
sudo mkdir -p /mount/legacyapp1/legacyfileshare sudo mount -t nfs legacyapp1.file.core.windows.net:/legacyapp1/legacyfileshare /mount/legacyapp1/legacyfileshare -o vers=4,minorversion=1,sec=sys
If you have done all these, then you have now mounted your NFS share, and it’s ready to store your legacy app files.
Summary: Deploy Legacy App to Azure Fileshare
In this article, we went through all the steps necessary to set up what is required before we can successfully start deploying our legacy files to Azure file share. We created a storage account, we created a file share in the storage account, we created a virtual machine, we created a private endpoint, we disabled secure transmission, and made the storage account ready for the transfer by installing all the necessary NFS files. Following the steps in the article to get your files are ready for transfer.
If you have any questions concerning this process on how to Deploy Legacy App to Azure Fileshare. Please leave them in the comments section below.