Create an Azure File Share and Mount It on the VM
Lab overview
Surf City Boats' server is deployed, secured, and reachable through Bastion. The last piece is shared storage. In this lab you create stsurfcityinfra001, a storage account set up for Azure Files on the HDD tier with locally-redundant storage, build the surfcity-files share on the transaction-optimized tier with backup turned off, and copy the Windows mount script from the portal. You then open a Bastion session to vm-surfcity-01, run the script in an elevated PowerShell window to map the share as Z:, create a test file on the drive, and confirm it appears when you browse the share from the Azure portal.
Why you'd do this
Azure Files is an SMB file share hosted by a storage account, and it's the cloud replacement for the department file server: mountable from Windows or Linux with a drive letter, reachable from on-premises, and managed without patching a server. For Surf City, it means the new VM and any future servers share one set of files that lives outside any single machine's disk.
The storage account form has changed, and this lab shows the current shape. Choosing Azure Files as the Primary service tunes the defaults for file shares; the HDD (standard) media tier and Pay-as-you-go billing keep this a general-purpose v2 account rather than a premium FileStorage account; and LRS is the right redundancy for a lab, though production file data usually warrants ZRS or GRS. The account name has to be globally unique, lowercase, and without hyphens, which is why it's stsurfcityinfra001 rather than the hyphenated naming you've used everywhere else. Require encryption in transit for SMB stays checked on the Advanced tab, and public network access is left enabled for this lab because the VM reaches the share over its public endpoint; locking that down with a private endpoint is a later-stage task.
Two choices on the share itself are worth noticing. Transaction optimized is the general-purpose tier; hot and cool trade higher transaction cost for cheaper storage and suit less-frequently accessed data. And you'll uncheck Enable backup, which otherwise creates a Recovery Services vault and a backup policy behind the scenes. That's a good default in production, but in a lab it deploys resources you didn't ask for.
The Connect pane does the hard part for you: it generates a PowerShell script that tests TCP 445 to the storage endpoint, stores the account key with cmdkey, and maps the drive with New-PSDrive -Persist. You'll use storage account key authentication here, which is the simplest path and the one to understand first; identity-based access through Active Directory or Entra Kerberos is the production upgrade. Watch the script output for TcpTestSucceeded : True before anything else, because a blocked port 445 is the usual reason a mount fails. Azure Files, storage tiers, redundancy, and mounting shares are all AZ-104 material, and the storage account fundamentals are core AZ-900.
Lab details
- Storage account:
stsurfcityinfra001inrg-surfcity-infra· Region: (US) East US (adjust the name if it's taken) - Primary service: Azure Files · Media tier: HDD (standard) · Billing: Pay-as-you-go file shares · Redundancy: LRS
- Advanced: Require Encryption in Transit for SMB checked · Networking: public network access Enable from all networks
- File share:
surfcity-files· Access tier: Transaction optimized · Backup: disabled - Mount: Windows script from the Connect pane · drive Z: · authentication: Storage account key · run in PowerShell as administrator on
vm-surfcity-01via Bastion - Test file:
surfcity-test.txtcreated on Z: and verified from the portal's Browse view
Learning objectives
- Create a storage account configured for Azure Files with an appropriate media tier, billing model, and redundancy.
- Create an SMB file share and choose its access tier.
- Generate and run the Windows mount script to map a file share as a drive letter.
- Connect to a private VM through Azure Bastion to perform server-side configuration.
- Verify a file written from the server appears in the share from the Azure portal.
Exam relevance
- AZ-900 — Microsoft Azure Fundamentals — Azure storage accounts, Azure Files, redundancy options, storage tiers.
- AZ-104 — Microsoft Azure Administrator — create and configure storage accounts, configure Azure Files shares and tiers, mount file shares on Windows, storage account access keys.
Where this lab fits in the project
This is the last of the six free labs and the first one where you work inside the server rather than around it. Lab 5's Bastion host is how you get a desktop on vm-surfcity-01, lab 4's NSG rule is what lets that session in, and the share you mount here is the last resource of the free build to land in the rg-surfcity-infra group you created in lab 1.
When you finish, Surf City Boats has a complete starting environment: a planned network, a privately addressed Windows Server, subnet-level security, a managed way in, and centralized storage mapped as a drive.
The project continues from here with an All-Access Pass. In lab 7 you'll start running this environment the way an IT team would, beginning with access control for a new administrator, then monitoring and alerts for the server.
Step-by-step instructions
- Open the Storage accounts service:
- On the Azure portal Home page, in the search box at the top, type
Storage accountsand select it under Services. - Select + Create.
- On the Azure portal Home page, in the search box at the top, type
- Configure the Basics tab:
- Confirm the Surf City Boats subscription is selected and choose resource group
rg-surfcity-infra. - In the Storage account name field, type
stsurfcityinfra001and select region (US) East US. - Under Primary service, select Azure Files; under Media tier, select HDD (standard); under File share billing, select Pay-as-you-go file shares.
- In the Redundancy dropdown, select Locally-redundant storage (LRS), then select Next.
- Confirm the Surf City Boats subscription is selected and choose resource group
- Review the Advanced and Networking tabs:
- Under Azure Files, confirm Require Encryption in Transit for SMB is checked, then select Next.
- Confirm Public network access is Enable and the scope is Enable from all networks, then select Review + create.
- Create the storage account:
- Confirm Validation passed is displayed, the Primary service shows Azure Files, and the Redundancy shows LRS.
- Select Create; when deployment completes, select Go to resource.
- Create the file share:
- Under Data storage, select Classic file shares, then + Classic file share.
- In the Name field, type
surfcity-files. - Open the Access tier dropdown to review the tiers and select Transaction optimized, then select Next: Backup.
- Uncheck Enable backup, select Review + create, then Create.
- Confirm the
surfcity-filesoverview page opens.
- Get the mount script:
- Select Connect and confirm the Windows tab is selected.
- In the Drive letter dropdown, select Z; under Authentication method, select Storage account key.
- Select Show script, then the Copy icon to copy the script to the clipboard.
- Connect to the VM through Bastion:
- In the search box at the top of the portal, type
vm-surfcity-01and select it under Resources. - On the Overview page, select Connect, then Connect via Bastion.
- Confirm Authentication Type is VM Password, enter
surfadmin/P@ssw0rd!123, and select Connect. - Confirm the Windows Server desktop opens in a new browser tab.
- In the search box at the top of the portal, type
- Mount the file share on the server:
- Select Start, type
PowerShell, right-click Windows PowerShell, and select Run as administrator. - Press Ctrl+V to paste the mount script; if prompted, allow the browser to access the clipboard.
- Press Enter to run the script.
- Confirm the output shows TcpTestSucceeded passed and the Z drive is listed with root
\\stsurfcityinfra001.file.core.windows.net\surfcity-files.
- Select Start, type
- Test read and write access:
- Select Start, then File Explorer; under This PC, confirm surfcity-files (\\stsurfcityinfra001.file.core.windows.net) (Z:) is listed and open it.
- Right-click in the empty folder, select New → Text Document, and name the file
surfcity-test. - Open
surfcity-test.txt, typeSurf City Boats shared storage test, and save the file. - Close Notepad and File Explorer, close the Bastion browser tab, and return to the Azure portal tab.
- Verify the file from the portal:
- In the search box at the top of the portal, type
stsurfcityinfra001and select it under Resources. - Under Data storage, select Classic file shares, then select
surfcity-files. - Select Browse and confirm
surfcity-test.txtis listed.
- In the search box at the top of the portal, type
Launch the lab simulation — free with a labITpro account; no Azure subscription required.