title: Accessing Azure File Storage from Azure Function
body: <p>I'm attempting to retrieve a file out of Azure File Storage to be used by an .exe that is executed within an Azure Function and can't seem to get pass the UNC credentials.  </p>
  
  <p>My app gets the UNC file path out of an Azure SQL database and then attempts to navigate to that UNC path (in Azure File Storage) to import the contents of the file.  I can navigate to the file location from my PC in windows explorer but am prompted for the credentials.  </p>
  
  <p>I've tried using a "net use" command prior to executing the app but it doesn't seem to authenticate.</p>
  
  <pre><code>net use \\&lt;storage account&gt;.file.core.windows.net\&lt;directory&gt;\ /u:&lt;username&gt; &lt;access key&gt;
  
  MyApp.exe 
  </code></pre>
  
  <p>Azure Function Log error:</p>
  
  <pre><code>Unhandled Exception: System.UnauthorizedAccessException: Access to the path '&lt;file path&gt;' is denied.
  </code></pre>
  
  <p>If possible, I'd rather not modify my C# app and do the authentication in the Azure Function (its a Batch function at the moment and will be timer based).</p>