We Have search implemented using Lucene.Net, Indexes are stored in Azure Storage Folder, Few days ago we moved our Web Application From Azure CloudService To Azure AppService. If we run this locally it works as expected, also works in CloudService But when we published our Web Application to Azure AppService we have below Exception:
System.UnauthorizedAccessException: Access to the path 'D:\AzureDirectory' is denied.
tried to update AzureDirectory and Azure Storage packages but it's not working.
Any Idea?
Thanks,
Solution was to change Lucene.Net.Store.Azure.AzureDirectory
s CacheDirectory
path to D:/Home/AzureDirectory
AzureDirectory(cloudStorageAccount, containerName, FSDirectory.Open(new DirectoryInfo("D:/Home/AzureDirectory")))
As you mentioned I had no d:\
access
tried to update AzureDirectory
As David Makogon mentioned that in the Azure WebApp, we have no access to create or access D:\AzureDirectory folder. We could get more info from the Azure WebApp Sandbox. The following is the snippet from the document
File System Restrictions/Considerations
Applications are highly restricted in terms of their access of the file system.
Home directory access (d:\home)
Every Azure Web App has a home directory stored/backed by Azure Storage. This network share is where applications store their content. This directory is available for the sandbox with read/write access.
According to the exception you mentioned, it seems that some code want to access the folder D:\AzureDirectory but it is not existed in the Azure WebApp. We also could remote debug our WebApp in the Azure to find the related code, more details please refer to the Remote debugging web apps.
You don't have d:\
access. In Web Apps, your app lives under d:\home
(more accurately d:\home\site
).
Also - fyi this isn't "Azure Storage" - that term refers to blob storage.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With