Skip to content

Azure Files - Identity auth

Lab Objective

In this hands-on lab, you will learn how to:

  • Understand Azure Files identity-based authentication using Azure AD
  • Configure Azure Files for Active Directory integration with on-premises or cloud identities
  • Set up share-level and file-level permissions using RBAC and NTFS ACLs
  • Test identity-based access from domain-joined virtual machines
  • Troubleshoot common authentication issues with Azure Files
  • Implement secure file sharing for enterprise scenarios

Scenario: Your organization needs to migrate on-premises file shares to Azure Files while maintaining existing Active Directory-based access controls. Users should be able to access Azure Files using their domain credentials with appropriate permissions based on their group memberships.


Pre-Provisioned Environment

The following Azure resources have been pre-deployed in your environment:

Resource Overview

Resource TypeResource NameConfigurationPurpose
Resource GroupAzureFiles-Lab-RGContains all lab resourcesLogical container
Storage Accountazurefileslab[unique]Premium FileStorageAzure Files host
File Sharecorporate-share100 GB quotaPrimary file share
File Sharedepartment-share50 GB quotaDepartment-specific share
Virtual NetworkCorp-VNetAddress space: 10.0.0.0/16Corporate network
Domain ControllerDC01Windows Server 2019Active Directory services
Client VMClient01Windows 11 EnterpriseDomain-joined client
Client VMClient02Windows 11 EnterpriseDomain-joined client
Azure AD ConnectPre-configuredHybrid identity syncDirectory synchronization

Active Directory Structure

Corporate Domain: corp.local
β”œβ”€β”€ Domain Controller (DC01)
β”œβ”€β”€ Organizational Units
β”‚ β”œβ”€β”€ Corporate Users
β”‚ β”‚ β”œβ”€β”€ Alice Johnson (HR Manager)
β”‚ β”‚ β”œβ”€β”€ Bob Smith (Finance Analyst)
β”‚ β”‚ └── Carol Davis (IT Administrator)
β”‚ └── Service Accounts
β”‚ └── AzureFilesSync
β”œβ”€β”€ Security Groups
β”‚ β”œβ”€β”€ HR-Users (Alice Johnson)
β”‚ β”œβ”€β”€ Finance-Users (Bob Smith)
β”‚ β”œβ”€β”€ IT-Admins (Carol Davis)
β”‚ └── All-Employees (All users)
└── Client Computers
β”œβ”€β”€ Client01 (Domain-joined)
└── Client02 (Domain-joined)

VM Details

VMPrivate IPOperating SystemDomain StatusPurpose
DC0110.0.0.4Windows Server 2019Domain ControllerAD DS services
Client0110.0.1.4Windows 11 EnterpriseDomain-joinedUser testing
Client0210.0.1.5Windows 11 EnterpriseDomain-joinedUser testing

Lab Exercises

Part 1: Examine Azure Files Configuration

Step 1: Navigate to Storage Account

  1. Navigate to AzureFiles-Lab-RG resource group
  2. Click on the Storage Account (azurefileslab[unique])
  3. In the left menu, click File shares
  4. Observe the pre-created shares:
    • corporate-share
    • department-share

Step 2: Check Current Authentication Method

  1. Click on corporate-share
  2. In the left menu, click Configuration
  3. Examine current settings:
    • Authentication method: Should show β€œStorage account key” initially
    • Access tier: Premium or Standard
    • Protocol: SMB 3.1.1

Step 3: Test Current Access Method

  1. In corporate-share, click Connect
  2. Copy the PowerShell command for mapping the drive
  3. Note: This uses storage account key authentication

Part 2: Configure Azure AD Authentication

Step 1: Enable Azure AD Authentication

  1. In the Storage Account, go to Configuration
  2. Under Azure Active Directory Domain Services, click Configure
  3. Enable Azure AD DS authentication:
    • Select β€œEnable Azure Active Directory Domain Services (Azure AD DS) authentication”
    • Note: This option enables cloud-only Azure AD authentication

Step 2: Configure On-Premises AD Integration

  1. Go to Configuration β†’ Identity-based access
  2. Select authentication method:
    • Choose β€œOn-premises Active Directory Domain Services”
    • This enables hybrid identity authentication

Step 3: Domain Join the Storage Account

From DC01, run PowerShell as Administrator:

Terminal window
# Install required PowerShell module
Install-Module -Name Az.Storage -Force
Import-Module Az.Storage
# Connect to Azure (if not already authenticated)
Connect-AzAccount
# Set variables
$resourceGroupName = "AzureFiles-Lab-RG"
$storageAccountName = "azurefileslab[unique]"
$domainName = "corp.local"
$ouPath = "OU=Service Accounts,DC=corp,DC=local"
# Domain join the storage account
$storageAccount = Get-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName
# Configure AD authentication
Set-AzStorageAccount -ResourceGroupName $resourceGroupName `
-Name $storageAccountName `
-EnableActiveDirectoryDomainServicesForFile $true `
-ActiveDirectoryDomainName $domainName `
-ActiveDirectoryDomainGuid (Get-ADDomain).ObjectGUID `
-ActiveDirectoryDomainSid (Get-ADDomain).DomainSID `
-ActiveDirectoryAzureStorageSid (Get-ADUser AzureFilesSync).SID
Write-Host "Storage account domain join completed"

Part 3: Configure Share-Level Permissions

Step 1: Set Up RBAC Roles

  1. Navigate to corporate-share
  2. Click Access Control (IAM)
  3. Add role assignments:

Assignment 1 - IT Administrators:

  • Role: Storage File Data SMB Share Elevated Contributor
  • Assign access to: User, group, or service principal
  • Select: IT-Admins group
  • Purpose: Full administrative access

Assignment 2 - HR Users:

  • Role: Storage File Data SMB Share Contributor
  • Select: HR-Users group
  • Purpose: Read/write access to HR folders

Assignment 3 - Finance Users:

  • Role: Storage File Data SMB Share Reader
  • Select: Finance-Users group
  • Purpose: Read-only access

Assignment 4 - All Employees:

  • Role: Storage File Data SMB Share Reader
  • Select: All-Employees group
  • Purpose: Basic read access to common folders

Step 2: Configure Department Share Permissions

  1. Navigate to department-share
  2. Add role assignments:

Assignment 1:

  • Role: Storage File Data SMB Share Contributor
  • Select: HR-Users group
  • Purpose: HR department full access

Assignment 2:

  • Role: Storage File Data SMB Share Reader
  • Select: Finance-Users group
  • Purpose: Finance read access for reports

Part 4: Test Identity-Based Access

Step 1: Connect to Client01 as Alice Johnson (HR Manager)

  1. Navigate to Client01
  2. Click Connect β†’ RDP
  3. Login as domain user:
    • Username: corp\alice.johnson
    • Password: LabPassword123!

Step 2: Mount Azure File Share

From Client01, open Command Prompt and run:

Terminal window
# Map corporate share using identity authentication
net use Z: \\azurefileslab[unique].file.core.windows.net\corporate-share
# Check if mapping succeeded
net use
# Navigate to the share
dir Z:\

Expected Result: Share should map successfully using Alice’s domain credentials

Step 3: Test File Operations as HR Manager

Terminal window
# Create HR folder structure
mkdir Z:\HR-Documents
mkdir Z:\HR-Documents\Policies
mkdir Z:\HR-Documents\Employee-Records
# Create test files
echo "HR Policy Document" > Z:\HR-Documents\Policies\hr-policy.txt
echo "Employee Record Sample" > Z:\HR-Documents\Employee-Records\sample.txt
# List created content
dir Z:\HR-Documents /s

Step 4: Test Department Share Access

Terminal window
# Map department share
net use Y: \\azurefileslab[unique].file.core.windows.net\department-share
# Create HR-specific content
mkdir Y:\HR-Department
echo "HR Department File" > Y:\HR-Department\department-info.txt
# Verify access
dir Y:\HR-Department

Part 5: Test Different User Permissions

Step 1: Connect as Bob Smith (Finance Analyst)

  1. Disconnect from Client01 or use Client02
  2. Login as:
    • Username: corp\bob.smith
    • Password: LabPassword123!

Step 2: Test Finance User Access

From Client02, open Command Prompt:

Terminal window
# Map corporate share as Finance user
net use Z: \\azurefileslab[unique].file.core.windows.net\corporate-share
# Try to access HR documents (should have read access only)
dir Z:\HR-Documents
# Try to create Finance folder
mkdir Z:\Finance-Reports
# Try to create files in Finance folder
echo "Finance Report Q3" > Z:\Finance-Reports\q3-report.txt
# Test read access to department share
net use Y: \\azurefileslab[unique].file.core.windows.net\department-share
dir Y:\

Expected Results:

  • Corporate Share: Read access only (cannot create/modify HR files)
  • Department Share: Read access only
  • Own Finance folder: May be able to create if NTFS permissions allow

Step 3: Test Access Restrictions

Terminal window
# Try to delete HR files (should fail)
del Z:\HR-Documents\Policies\hr-policy.txt
# Try to modify HR files (should fail)
echo "Modified by Finance" >> Z:\HR-Documents\Policies\hr-policy.txt
# Check error messages
echo %ERRORLEVEL%

Part 6: Configure File-Level NTFS Permissions

Step 1: Connect as IT Administrator

  1. Login to Client01 as:
    • Username: corp\carol.davis
    • Password: LabPassword123!

Step 2: Set NTFS Permissions

From Client01 PowerShell as IT Admin:

Terminal window
# Map share with elevated permissions
net use Z: \\azurefileslab[unique].file.core.windows.net\corporate-share
# Set NTFS permissions for HR folder
icacls Z:\HR-Documents /grant "corp\HR-Users:(OI)(CI)F" /T
icacls Z:\HR-Documents /grant "corp\Finance-Users:(OI)(CI)R" /T
icacls Z:\HR-Documents /remove "corp\All-Employees" /T
# Create Finance folder with appropriate permissions
mkdir Z:\Finance-Reports
icacls Z:\Finance-Reports /grant "corp\Finance-Users:(OI)(CI)F" /T
icacls Z:\Finance-Reports /grant "corp\HR-Users:(OI)(CI)R" /T
# Set common area permissions
mkdir Z:\Common
icacls Z:\Common /grant "corp\All-Employees:(OI)(CI)M" /T
# Verify permissions
icacls Z:\HR-Documents
icacls Z:\Finance-Reports
icacls Z:\Common

Step 3: Test Granular Permissions

Switch back to Bob Smith (Finance):

Terminal window
# Test Finance folder access (should have full control now)
echo "Finance data" > Z:\Finance-Reports\test.txt
mkdir Z:\Finance-Reports\Quarterly
# Test HR folder access (should be read-only)
type Z:\HR-Documents\Policies\hr-policy.txt
echo "Finance comment" > Z:\HR-Documents\finance-comment.txt
# Test Common area (should have modify access)
echo "Shared document" > Z:\Common\shared.txt

Part 7: Monitor and Troubleshoot Access

Step 1: Enable Storage Analytics

  1. In Storage Account, go to Monitoring β†’ Diagnostic settings
  2. Add diagnostic setting:
SettingValuePurpose
NameAzureFiles-DiagnosticsConfiguration name
FileCheckedEnable file service logging
StorageReadCheckedLog read operations
StorageWriteCheckedLog write operations
StorageDeleteCheckedLog delete operations
  1. Destination: Choose Log Analytics workspace

Step 2: Test Access Logging

Generate various access patterns:

Terminal window
# Successful operations
dir Z:\
type Z:\Common\shared.txt
# Failed operations (wrong user)
del Z:\HR-Documents\Policies\hr-policy.txt
mkdir Z:\Restricted-Area

Step 3: Query Access Logs

In Log Analytics, run queries:

// View file access patterns
StorageFileLogs
| where TimeGenerated > ago(1h)
| where AccountName == "azurefileslab[unique]"
| project TimeGenerated, AuthenticationType, AuthenticationHash, CallerIpAddress, Uri, StatusCode, StatusText
| order by TimeGenerated desc
// Failed authentication attempts
StorageFileLogs
| where TimeGenerated > ago(1h)
| where StatusCode == 403
| project TimeGenerated, CallerIpAddress, Uri, StatusText
| order by TimeGenerated desc

Part 8: Advanced Configuration

Step 1: Configure Azure AD Connect (Pre-configured)

Verify synchronization status:

From DC01 PowerShell:

Terminal window
# Check Azure AD Connect status
Import-Module ADSync
Get-ADSyncScheduler
# Force synchronization if needed
Start-ADSyncSyncCycle -PolicyType Delta
# Verify users are synchronized to Azure AD
Get-AzureADUser -Filter "userPrincipalName eq 'alice.johnson@corp.local'"

Step 2: Configure Kerberos Authentication

Enable Kerberos for enhanced security:

Terminal window
# Configure Kerberos authentication on storage account
Set-AzStorageAccount -ResourceGroupName "AzureFiles-Lab-RG" `
-Name "azurefileslab[unique]" `
-EnableKerberosTicketEncryption $true
# Test Kerberos authentication
klist tickets

Step 3: Setup File Sync (Optional)

Configure Azure File Sync for hybrid scenarios:

  1. Install Azure File Sync agent on DC01
  2. Register server with Storage Sync Service
  3. Create sync group for bidirectional sync
  4. Configure cloud tiering for storage optimization

Troubleshooting Guide

Common Azure Files Identity Issues

IssueSymptomsPossible CauseSolution
Access denied403 errors when mountingIncorrect RBAC permissionsCheck share-level role assignments
Authentication failuresCannot mount with domain credentialsAD integration not configuredVerify domain join and AD authentication
Permission errorsCan mount but cannot access filesNTFS permissions restrictiveAdjust file-level permissions with icacls
Slow performanceFile operations are slowNetwork or authentication latencyCheck network connectivity and Kerberos config
Sync issuesAzure AD users not recognizedAzure AD Connect problemsVerify directory synchronization

Permission Troubleshooting

Permission LevelScopeConfiguration LocationTest Method
Share-levelEntire file shareAzure Portal IAMMount share attempt
File-levelIndividual files/foldersNTFS permissions (icacls)File operation attempt
Azure ADUser/group identityAzure AD portalUser authentication
On-premises ADDomain authenticationDomain controllerDomain login

Additional Experiments

Try these optional exercises to deepen your understanding:

  • Multi-forest scenarios: Configure trust relationships for complex AD environments
  • Hybrid identity: Test with Azure AD-only users vs synchronized users
  • Performance optimization: Configure SMB multichannel and optimize network settings
  • Backup integration: Set up Azure Backup for Azure Files
  • Cross-platform access: Test Linux client access to Azure Files with identity

Key Takeaways

After completing this lab, you should understand:

  • Azure Files supports identity-based authentication using on-premises AD or Azure AD
  • Share-level permissions are managed through Azure RBAC roles
  • File-level permissions use traditional NTFS ACLs for granular control
  • Domain joining storage accounts enables seamless integration with existing AD infrastructure
  • Azure AD Connect synchronizes on-premises identities to the cloud
  • Monitoring and logging are essential for troubleshooting access issues
  • Hybrid scenarios combine cloud and on-premises identity management

Azure Files Authentication Methods

Authentication Comparison

MethodUse CaseComplexitySecurityBest For
Storage Account KeySimple scenariosLowMediumDevelopment/testing
Azure AD DSCloud-only environmentsMediumHighCloud-native organizations
On-premises ADHybrid environmentsHighHighTraditional enterprises
Azure AD (Kerberos)Modern hybridMediumHighestModern enterprises

Permission Model

Azure Files Permission Hierarchy
β”œβ”€β”€ Share-level (Azure RBAC)
β”‚ β”œβ”€β”€ Storage File Data SMB Share Reader
β”‚ β”œβ”€β”€ Storage File Data SMB Share Contributor
β”‚ └── Storage File Data SMB Share Elevated Contributor
└── File-level (NTFS ACLs)
β”œβ”€β”€ Full Control (F)
β”œβ”€β”€ Modify (M)
β”œβ”€β”€ Read & Execute (RX)
β”œβ”€β”€ Read (R)
└── Write (W)

Migration Best Practices

Pre-Migration Planning

  • Assess current file share structure and permissions
  • Identify user groups and access patterns
  • Plan Azure AD integration strategy
  • Design folder structure for optimal performance

Migration Process

  1. Set up Azure AD Connect for identity synchronization
  2. Configure Azure Files with appropriate authentication method
  3. Create file shares with initial folder structure
  4. Configure share-level permissions using Azure RBAC
  5. Migrate data using AzCopy or Azure File Sync
  6. Set file-level permissions using NTFS ACLs
  7. Test user access from different clients
  8. Monitor and optimize performance post-migration

Additional Resources