Last updated on November 5, 2021
Task 5: Create and configure an Azure Files sharesIn this task, you will create and configure Azure Files shares and use a VM to store them
To create an Azure file share, you need to answer three questions about how you will use it:
What are the performance requirements for your Azure file share?
hard-disk HDD Based, premium file shares SSD Based hardware.
What are your redundancy requirements for your Azure file share?
LRS one region 3 copy, GRS two region 6 copy
What size file share do you need?
100 Tib, 5 Tib (geo and geo-zone redundant storage account.
There are many possibilities:
Mount SMB Azure file share on Windows
Mount SMB Azure file share on Linux
Quickstart: Create and manage Azure file shares with Windows virtual machines
Create a rg and get it:
az login #or az login --tenantID $loc = "WEST EUROPE" $rgName = "az104-07-rg0" New-AzResourceGroup -Name $rgName -Location $loc Get-AzResourceGroup -ResourceGroupName $rgName
Create the VM (we do it in the portal here) and login:
Rg az104-07-rg0 Virtual macine name az104testVM region West Europe Availability opt. Availability zone, 1 Image Windows Server 2016 Datacenter -Gen2 Size B2s General purpose, 2 vcpu, 4 gib memory u Ledzepplin, Ledzepplin and the numbers Pub inbound por Allowe selected Select inbound por RDP, 3389 Disk Standard SSD, lrs Network Create all new and keep default Management keep default Advanced Keep default Tags none Review + create Price, 0.0769 AUD/hr
Keep the rest default for now as mentioned, delete the rg after the test is done, this is cheap VM.
Login to the VM:
Cool, now create a storage account:
Rg az104-07-rg0 Storage account name az104storageledzepplin Region West Europe Performance Standard Redundancy LRS Networking Public endpoint (all networks, it is secure, user needs KEY or SAS)
Cool, now create file shares from the storage account:
Go to the file share, press connect and copy the script after you have selected Windows.
Then go to the VM and execute the script remote from the portal.
Output from script:
Output CMDKEY: Credential added successfully. Name Used (GB) Free (GB) Provider Root ---- --------- --------- -------- ---- Z 0.00 5120.00 FileSystem \\az104storageledzeppli...
Now let’s create a folder and some files on the VM, paste the code in the same script window as the connect script on the VM’s Run command blade, az104testVM | Run command:
New-Item -Type Directory -Path 'Z:\az104testVM-folder' New-Item -Type File -Path 'Z:\az104testVM-folder\az104testVMfile.txt'
Now navigate back to the file share and verify folder and file.
Add some more files.
New-Item -Type File -Path 'Z:\az104testVM-folder\az104testVMaswsd.txt'
To give individual accounts access to the file share (Kerberos), enable identity-based authentication for the storage account.
What did we create in rg az104-07-rg0?
Delete the rg and all resources:
Get-AzResourceGroup -Name 'az104-07*' | Remove-AzResourceGroup -Force -AsJob Id Name PSJobTypeName State HasMoreData Location Command -- ---- ------------- ----- ----------- -------- ------- 1 Long Running... AzureLongRun... Running True localhost Remove-AzResourceGrou
It can take some time to delete all the resources