Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Team Services Build Artifacts

I'm attempting to create a build that will build my solution, apply web.config transforms as necessary and finally copy desired output (a built web api project) to the artifacts area of the build.

I'm using the Deployment...Azure WebApp Template with the Azure App Service Deploy step disabled (as we're in the middle of a move to Azure), with the following build arguments in the build step:

/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\" /p:AutoParameterizationWebConfigConnectionStrings=False

All works as expected, apart from the structure of the resulting zip file, which has the following structure:

{ZipFileName}{ProjectName\Content\C_C\a\1\s\Api{ProjectName\obj\Release\Package\PackageTmp...{BuildContent}

I'd like the content to be at the root of the published zip file if possible. Is the best way to manipulate the content of $(build.artifactstagingdirectory) using Powershell or a number of the other built in build tasks?

like image 341
Matt Rowett Avatar asked Dec 05 '25 10:12

Matt Rowett


1 Answers

You don’t need to worry about it, because it won’t keep the folder structure (Just the files and folders in PackageTmp folder) after deploy to web server (e.g. IIS, Azure Web App)

If you still need to just include the files in PackageTmp folder, you can add build step to archive file to zip file through Archive Files step.

For Visual Studio Build step, specify /p:DeployOnBuild=true to MSBuild Arguments.

enter image description here

like image 157
starian chen-MSFT Avatar answered Dec 07 '25 03:12

starian chen-MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!