Reputation: 426
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
As documented Here
Can anyone advise on what I am doing wrong here?
Thanks
Upvotes: 2
Views: 3063
Reputation: 33708
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
Upvotes: 0
Reputation: 4001
I do it in a 2 step process
/p:DeployOnBuild=true /p:DeployTarget=Package;CreatePackageOnPublish=true
Prefix root folder name...
unchecked.Upvotes: 2