About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
powershell_heavy
⚠️
windows_first
⚠️
windows_tools
Summary:
The documentation demonstrates a moderate Windows bias. PowerShell is used as the primary scripting interface for both Windows and Linux examples, rather than showing native Linux shell commands. Windows tools and patterns (e.g., 'net use', 'cmdkey') are described in detail, and Windows-specific troubleshooting steps and references are often presented before or more prominently than their Linux equivalents. The documentation also references Windows tools and workflows in several places, sometimes before mentioning Linux alternatives.
Recommendations:
- Provide native Linux shell (bash) examples alongside or instead of PowerShell for Linux scenarios, especially for manual mounting and troubleshooting.
- Balance the order of presentation so that Linux and Windows instructions/examples are given equal prominence, or alternate which comes first.
- Include Linux-native troubleshooting commands (e.g., 'mount', 'dmesg', 'journalctl') and log file locations, not just Windows RDP and log file paths.
- Reference Linux-specific documentation and tools (such as mount.cifs, mount.nfs, systemd unit files) where appropriate.
- Clarify when PowerShell is required on Linux, and offer alternatives for users who prefer bash or other shells.
- Ensure that all code snippets and workflows are equally detailed for both platforms, avoiding extra detail or explanation for Windows-only tools.
Create pull request
Flagged Code Snippets
1. Connect to the node and check that the output file is correct.
### Access the mounted files
Azure Batch tasks can access the mounted files by using the drive's direct path, for example:
If you receive this error, RDP or SSH to the node to check the related log files. The Batch agent implements mounting differently on Windows and Linux for Azure file shares. On Linux, Batch installs the package `cifs-utils`. Then, Batch issues the mount command. On Windows, Batch uses `cmdkey` to add your Batch account credentials. Then, Batch issues the mount command through `net use`. For example:
# [Windows](#tab/windows)
1. Connect to the node over RDP.
1. Open the log file *fshare-S.log*, at *D:\batch\tasks\fsmounts*.
1. Review the error messages, for example:
1. Troubleshoot the problem by using the [Azure file shares troubleshooter](https://support.microsoft.com/help/4022301/troubleshooter-for-azure-files-shares).
### Manually mount a file share with PowerShell
If you can't diagnose or fix mounting errors, you can use PowerShell to mount the file share manually instead.
# [Windows](#tab/windows)
1. Create a pool without a mounting configuration. For example:
### CIFS
Mounting [CIFS](/windows/desktop/fileio/microsoft-smb-protocol-and-cifs-protocol-overview) to pool nodes is another way to provide access to traditional file systems. CIFS is a file-sharing protocol that provides an open and cross-platform mechanism for requesting network server files and services. CIFS is based on the enhanced version of the [SMB protocol](/windows-server/storage/file-server/file-server-smb-overview) for internet and intranet file sharing.
The following example shows a configuration for a CIFS file mount.
1. Get the context for your Batch account. Replace the `<batch-account-name>` placeholder with your Batch account name.
1. Create a Batch pool with the following settings. Replace the `<storage-account-name>` , `<storage-account-key>`, and `<file-share-name>` placeholders with the values from the storage account that's linked to your Batch account. Replace the `<pool-name>` placeholder with the name you want for the pool.
The following script creates a pool with one Windows Server 2016 Datacenter, Standard_D2_V2 size node, and then mounts the Azure file share to the *S* drive of the node.
The Azure Batch agent grants access only for Azure Batch tasks. If you use Remote Desktop Protocol (RDP) to connect to the node, your user account doesn't have automatic access to the mounting drive. When you connect to the node over RDP, you must add credentials for the storage account to access the *S* drive directly.
Use `cmdkey` to add the credentials. Replace the `<storage-account-name>` and `<storage-account-key`> placeholders with your own information.
1. Get the context for your Batch account, replacing the placeholder with your Batch account name.
1. Create a Batch pool with the following settings. Replace the `<storage-account-name>` , `<storage-account-key>`, and `<file-share-name>` placeholders with the values from the storage account that's linked to your Batch account. Replace the `<pool-name>` placeholder with the name you want for the pool.
The following script creates a pool with one Ubuntu 20.04, Standard_DS1_v2 size node, and then mounts the Azure file share to the *S* drive of the node.
1. Wait for the node to be in the **Idle** state.
1. In the [Azure portal](https://portal.azure.com), search for and select the storage account that has your file share.
1. On the storage account page's menu, select **File shares** from the left navigation.
1. On the **File shares** page, select the file share you want to mount.
1. On the file share's page, select **Connect**.
1. In the **Connect** pane, select the **Windows** tab.
1. For **Drive letter**, enter the drive you want to use. The default is *Z*.
1. For **Authentication method**, select how you want to connect to the file share.
1. Select **Show Script**, and copy the PowerShell script for mounting the file share.
1. Connect to the node over RDP.
1. Run the command you copied to mount the file share.
1. Note any error messages in the output. Use this information to troubleshoot any networking-related issues.
# [Linux](#tab/linux)
1. Create a pool without a mounting configuration. For example:
1. Wait for the node to be in the **Idle** state.
1. In the [Azure portal](https://portal.azure.com), search for and select the storage account that has your file share.
1. On the storage account page's menu, select **File shares** from the left navigation.
1. On the **File shares** page, select the file share you want to mount.
1. On the file share's page, select **Connect**.
1. In the **Connect** pane, select the **Linux** tab.
1. Enter the **Mount point** you want to use.
1. Copy the Linux script for mounting the file share.
1. Connect to the node over SSH.
1. Run the command you copied to mount the file share.
1. Note any error messages in the output. Use this information to troubleshoot any networking-related issues.
---
## Example mount configurations
The following code example configurations demonstrate mounting various file share systems to a pool of compute nodes.
### Azure Files share
Azure Files is the standard Azure cloud file system offering. The following configuration mounts an Azure Files share named `<file-share-name>` to the *S* drive. For information about the parameters in the example, see [Mount SMB Azure file share on Windows](/azure/storage/files/storage-how-to-use-files-windows) or [Create an NFS Azure file share and mount it on a Linux VM using the Azure portal](/azure/storage/files/storage-files-how-to-create-nfs-shares).