2
votes

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: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"

This is giving me a Zip where the folder structure of \Content\D_C\a\3\s\MyFunctions\obj\Release\net461\PubTmp\Out. The Out directory has the content I need and what I'd expect to be the root

The folder structure I need to push a Zip is

enter image description here

As documented Here

Can anyone advise on what I am doing wrong here?

Thanks

2
Have you tried to push it ? there is nothing wrong with your package, you shouldn't care about the VSTS pathThomas
Do you solve this issue?starian chen-MSFT

2 Answers

2
votes

I do it in a 2 step process

  1. build with a VSTS Build task with settings /p:DeployOnBuild=true /p:DeployTarget=Package;CreatePackageOnPublish=true
  2. ZIP it with a VSTS Archive Files task. Here I leave the option to Prefix root folder name... unchecked.

Sample: sample Archive files task

0
votes

With Azure App Service Deploy task and Publish using Web Deploy option, it won’t remain the folder structure and the content files will be in wwwroot folder of azure app service. So you don’t need to care the package folder structure.

Otherwise, you can publish the app through FileSystem publish method (e.g. /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:publishUrl="$(build.artifactstagingdirectory)\\" /p:DeployDefaultTarget=WebPublish), then zip files through Archive files task, after that you can deploy it through Zip push deployment way (Azure CLI or PowerShell)

Zip push deployment for Azure Functions