title: Using VSTS to publish Azure Function to Zip file
body: <p>I am trying to use VSTS to publish a project that contains an Azure Function. My MSBuild step is passing the following build arguments</p>
  
  <blockquote>
    <p>/p:Configuration=Release /p:DeployOnBuild=true
    /p:WebPublishMethod=Package /p:PackageAsSingleFile=true
    /p:SkipInvalidConfigurations=true
    /p:PackageLocation="$(build.artifactstagingdirectory)\MyFunctions.$(Build.BuildNumber)-dev.zip"
    /p:DeployIisAppPath="Default Web Site"</p>
  </blockquote>
  
  <p>This is giving me a Zip where the folder structure of <strong><em>\Content\D_C\a\3\s\MyFunctions\obj\Release\net461\PubTmp\Out</em></strong>. The Out directory has the content I need and what I'd expect to be the root</p>
  
  <p>The folder structure I need to push a Zip is</p>
  
  <p><a href="https://i.stack.imgur.com/pBuHy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pBuHy.png" alt="enter image description here"></a></p>
  
  <p>As documented <a href="https://docs.microsoft.com/en-us/azure/azure-functions/deployment-zip-push" rel="nofollow noreferrer">Here</a></p>
  
  <p>Can anyone advise on what I am doing wrong here?</p>
  
  <p>Thanks</p>