I'm using dotnet core 2.0, building in Visual Studio Team Services (VSTS). I added the built-in Visual Studio Build step and am using msbuild with the following arguments:
/p:DeployOnBuild=true
/p:WebPublishMethod=Package
/p:PackageAsSingleFile=true
/p:SkipInvalidConfigurations=true
/p:DeployIisAppPath="Default Web Site"
/p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\MyProject.BuildVersion.zip"
This would build a zip file, but the internal structure was ugly and included the entire artifact staging directory as subfolders. E.g., the path inside my zip file until I got to the actual website file structure was Content\d_C\a\1\s\src\MyProjectName\obj\Release\netcoreapp2.0\PubTmp\Out
Is there a way to zip up just the project files and have those in the root of the zip file? I have a workaround using a few extra steps, but it would be nice to be able to use a single build step that also zips everything.
Edit
We use Octopus Deploy for deploying to Azure.
Since it is a dotnet core 2.0 project, you can publish project through .NET Core task:
For Visual Studio Build task, you can try to specify /P:PackageTempRootDir=""
argument, it will remove source path.
On the other hand, with Azure App Service deploy, the folder structure won’t be remained after deploying to the azure, you can check the folder and files by accessing https://[app name].scm.azurewebsites.net/DebugConsole
.