Reputation: 77
I want build and release one dot net app from VSTS to Azure web app . For this I have added some steps as shown in snap
apart from this whenever i do build solution, it fails or succeed but artifact is empty (sometimes). Also logs shows error
D:\a\1\s is empty. No artifacts Build is failed everytime with following two errors. Shall I reinstall Nuget packages? What is value for $(build.artifactstagingdirectory) Also please let me know what process should I follow.
Note: Azure app ( free tier plan ). App is developed in VS 2015. Kindly let me know if any information required.
Upvotes: 0
Views: 256
Reputation: 33698
You can call dotnet publish command through .Net Core (Command: publish, Arguments: -c $(BuildConfiguration) -o $(Build.ArtifactStagingDirectory), Check Zip Published Projects
) or Command Line step/task to publish your web to artifact directory, then archive the output into a Web Deploy package if you are using Command Line step/task.
More information, you can refer to this article: Build and deploy your ASP.NET Core app to Azure
Update:
You are using Asp.Net app, refer to these steps to create a new build definition:
With this template, you can find that there is MSBuild Arguments: /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\
" for Visual Studio Build step/task, which is used to publish web app to web deployment package (zip).
Note: if there is error during the build, the web deployment package won’t be generated, so it can’t find the file to publish for Publish Build Artifacts step/task. You can uncheck the option of Always run.
Upvotes: 1