IIS 7.5 - Virtual directory mapped to Azure File Share - Cannot read configuration file
<p>As the title suggests I am receiving an error "Cannot read configuration file" when attempting to read a JPG file from an Azure File share mounted on a VM (from within Azure network) through a virtual directory from within IIS 7.5</p>

<p>This points to a permission problem - I created a local user on the web server matching the username and set the password to the Access Key of the storage service on Azure (the same credentials to access/mount the file storage share).</p>

<p>I set this on the app pool the vdir runs under aswell as the virtual directory properties "Physical Path Credentials" - both still return the following error:</p>

<p><strong>HTTP Error 500.19 - Internal Server Error</strong></p>

<p>The requested page cannot be accessed because the related configuration data for the page is invalid.</p>

<p>Detailed Error Information:</p>

<p>Module
   IIS Web Core </p>

<p>Notification
   BeginRequest </p>

<p>Handler
   Not yet determined </p>

<p>Error Code
   0x80070003 </p>

<p>Config Error
   Cannot read configuration file  </p>

<p>Config File
   \?\X:\web.config </p>

<p>Requested URL
   <a href="http://localhost:80/myvdir/1.jpg" rel="nofollow">http://localhost:80/myvdir/1.jpg</a></p>

<p>Physical Path
   X:\1.jpg </p>

<p>Logon Method
   Not yet determined </p>

<p>Logon User
   Not yet determined </p>

<p>Config Source:
   -1: 
    0: </p>

<p>So either the credentials i'm using do not match the UNC credentials or IIS does not support this.</p>

<p>Anyone have any ideas?</p>

<p><strong>UPDATE - 2016-15-18</strong></p>

<p><strong><em>Solved</em></strong></p>

<p>Thanks to Simon W and Forester123</p>

<p>The issue was due to the following missing steps:</p>

<ul>
<li>When adding the local user I failed to add this user to the IIS_IUSRS group</li>
<li>Using the drive letter at the start of the physical path for the application. You must use the UNC path \myaccount.file.core.windows.net\sharename you cannot use a drive letter e.g. X:\</li>
</ul>

<p>This URL (provided by Simon W) was invaluable <a href="http://blogs.iis.net/davidso/azurefile" rel="nofollow">http://blogs.iis.net/davidso/azurefile</a></p>