title: unable to perform a right-click --> deploy on azure function
body: <p>I'm attempting to publish my azure function from visual studio, by right clicking on the <code>project--&gt;deploy</code> and then selecting <code>publish</code>.</p>
  
  <p>I get the following exception:</p>
  
  <blockquote>
    <p>C:\Program Files\dotnet\sdk\2.1.502\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(139,5): error : Web deployment task failed. (Web Deploy cannot modify the file 'AAAUtilities.dll' on the destination because it is locked by an external process.  In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt.  Learn more at: <a href="http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE</a>.) [C:\tfs\CCC\AAA\AAAUtilities\DEV\AAAUtilities\AAAUtilities.csproj]
          Publish failed to deploy.</p>
  </blockquote>
  
  <p><strong>What am I doing incorrectly?</strong></p>
  
  <ul>
  <li>Visual studio is opened as administrator</li>
  <li>Project builds locally and I am able to run it locally</li>
  <li>I've also downloaded the publish profile from the portal, in order to use for deployment, and that yielded the same exception</li>
  </ul>