2

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

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).

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:

HTTP Error 500.19 - Internal Server Error

The requested page cannot be accessed because the related configuration data for the page is invalid.

Detailed Error Information:

Module IIS Web Core

Notification BeginRequest

Handler Not yet determined

Error Code 0x80070003

Config Error Cannot read configuration file

Config File \?\X:\web.config

Requested URL http://localhost:80/myvdir/1.jpg

Physical Path X:\1.jpg

Logon Method Not yet determined

Logon User Not yet determined

Config Source: -1: 0:

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

Anyone have any ideas?

UPDATE - 2016-15-18

Solved

Thanks to Simon W and Forester123

The issue was due to the following missing steps:

  • When adding the local user I failed to add this user to the IIS_IUSRS group
  • 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:\

This URL (provided by Simon W) was invaluable http://blogs.iis.net/davidso/azurefile

John Mason
  • 81
  • 1
  • 6

2 Answers2

3

Trying to use a mapped drive is likely your issue. Take a look at how this is achieved using a UNC instead: http://blogs.iis.net/davidso/azurefile

Simon W
  • 5,481
  • 3
  • 24
  • 35
  • Changing to UNC path instead of mapped drive, and ensuring the local user was in the right group solved it - cheers! – John Mason May 18 '16 at 16:23
2

You need to specify the UNC path of your file share as the Physical Path property:

\\<your_storage_account>.file.core.windows.net\<your_share>

enter image description here

Using mapped drive will just give the error you encountered. Mapped drive is only for the local user session. See below test:
enter image description here enter image description here

forester123
  • 1,549
  • 10
  • 10
  • Yes thats exactly same error I was getting - ensuring UNC path instead of the drive path and ensuring the user was in the right group fixed it – John Mason May 18 '16 at 16:24