I am trying to write a file to a location on a shared network drive on a remote server. When I run my code in my local environment, it works successfully and I can upload files. However, when running the code from an Azure WebJob, I get
Access to the path is denied
or
Access is denied
I am accessing the netwrok share using a method as posted here
and implementing as follows:
using (NetworkShareAccesser.Access(REMOTE_COMPUTER_NAME, DOMAIN, USER_NAME, PASSWORD))
{
File.WriteAllText(string.Format(@"{0}\TestFileName.csv", networkPath), sb.ToString());
}
As I say, if I run this on my local pc, it works and uploads the file. Something is different when running from an Azure WebJob. Is there some extra permission/ security required to access the shared drive from Azure?
Thanks in advance.