How to Host IIS on Azure Files

Azure Point-to-Site VPN

Table of Contents

How to Host IIS on Azure Files:

When scaling or centralizing IIS web content across Azure-based infrastructure, one of the most efficient solutions is to host IIS on Azure Files directly. This approach allows you to serve site assets from a secure, cloud-native SMB share, eliminating the need for local storage dependencies and complex domain-joined setups.

In this guide, we’ll walk through how to host IIS on Azure Files using storage account credentials, mapped drives or UNC paths, and clean application pool identity configurations. Whether you’re running a standalone VM or managing multiple sites across a web farm, this method offers simplicity, scalability, and centralized file management without compromising on control or performance.

Why Use Azure Files with IIS?

  • Centralized Content Storage — Easy file management across multiple web servers
  • Cross-VM Consistency — One shared source for website assets
  • Cost-Efficient — Avoids high-performance premium disks for basic websites
  • Secure Access — Supports granular share-level control without exposing file systems
  • No ADDS Required — Works in standalone environments using local accounts and storage keys

When to Use This Setup:

  • SMBs and MSPs deploying IIS-based apps in cloud-first scenarios
  • Lift-and-shift legacy apps that need centralized file storage
  • Web farms or multi-VM IIS setups using shared content
  • Demo sites or client-facing tools where Azure-native storage is preferred
  • BYOD-style setups without complex identity infrastructure

Check out our Video here on our YouTube channel Don’t forget to subscribe to see our latest videos and keep updated with us and Azure.

Can we use SAS Keys?

SAS Tokens Don’t Work with SMB Access

Unfortunately, you can’t use a SAS token to mount Azure File Shares via SMB, which is what IIS relies on when accessing the share as a filesystem. Here’s why:

  • SAS tokens are designed for REST-based access, not SMB.
  • SMB authentication only supports:
    • Storage account name + key
    • Azure AD DS or AD DS credentials (if domain-joined)
    • SAS tokens are ignored by SMB clients, including Windows and IIS.
  • Even if you create a SAS with full permissions, it won’t authenticate SMB sessions — only REST API calls like those used by Storage Explorer or SDKs.

When SAS Does Work?

  • When you’re accessing the file share via REST API (e.g., in a web app or script).
  • When you’re using Azure Storage Explorer or similar tools.
  • When you’re building a proxy service that fetches content via REST and serves it to IIS.

Step-by-Step: Host IIS Site on Azure Files (No AD Join)

 1. Create Azure Storage Account & File Share

  • Go to Azure Portal → Storage Accounts → Create.
    • Use a name ≤ 20 characters to avoid SMB user length issues.
    • Select Standard performance and StorageV2 (general purpose v2).
    • Enable Secure transfer and disable Large file shares (unless needed).
  • After creation:
    • Go to File shares → Add new share.
    • Name it (e.g., iiscontent) and set a quota (e.g., 5 GB).

 2. Get Storage Account Key

  • Go to the storage account → Access keys.
  • Copy the Storage account name and Key1.

 3. Create Matching Local User on VM

  • Only needed if you want to impersonate via IIS
  • In Command Prompt or PowerShell:

 net user “storageaccountname” /add

  • Add the user to IIS_IUSRS group:

 net localgroup IIS_IUSRS /add

 4. Map the Azure File Share on VM

  • Use net use to map the share as a drive (e.g. Y:):

 net use Y: \\<storageaccount>.file.core.windows.net\<fileshare> /user:<storageaccount> <storageaccountkey> /persistent:yes

  • Confirm the share is reachable

Test-Path “Y:\iiscontent”

  • It should come back as “True”

 5. Copy Website Files to File Share

 6. Configure IIS Website

  • Open IIS Manager:
  • Right-click Sites → Add Website.
  • Name: AzureIIS
  • Physical Path: Y:\iiscontent
  • Port: 80 or your preferred setting

 7. Set Site Credentials (Optional)

  • Select your site → Basic Settings → Connect As…
  • Choose Specific User
  • Username:
  • Password:

If you’re using the local Windows user with matching name, this lets IIS authenticate to SMB share.

 8. Test the Setup

  • Drop a simple index.html into the share.
  • Browse to http://localhost or assigned port.
  • Validate response and check Event Viewer if any 500 errors occur.

Summary: How to Host IIS on Azure Files

This guide explains how to host IIS on Azure Files by mapping an SMB share to a Windows Server and configuring IIS to serve website content directly from cloud storage. It covers setup steps for secure access using storage account credentials, resolving authentication issues, configuring application pool identities, and optimising IIS for UNC path access. Ideal for cloud-based web hosting, this solution provides centralised file management, seamless scalability, and secure IIS integration—without requiring Active Directory.

Stay connected with LA NET

Stay connected with us on LinkedIn and YouTube for more tips and updates. Download our new eBook for an in-depth guide on optimising your Azure environment.

     LinkedInFollow us on LinkedIn

     YouTubeSubscribe to our YouTube Channel

     E-BookDownload our E-Book