How to pack .net framework Web App on Azure Pipelines
I need to create an azure artifact for a web app written in .net framework. The artifact will be used to automate the deploy.
If i use the generic artifact publisher, i will include code files in the artifact and other undesirable items.
There is some equivalent way to build a clean artifact for classic web apps build on .net framework?
Found a solution by automatically run publish on build. The steps are:
-
Create a publish to folder profile, name
FolderProfile
.I used the defaults that point to a target path at bin\app.publish
-
Use MS Build to the publish to folder by using
FolderProfile
saved profile. Add the following task to yaml file, right after the build solution task:- task: MSBuild@1 inputs: solution: 'MyPortal\MyPortal.csproj' msbuildArchitecture: 'x64' msbuildArguments: '/p:DeployOnBuild=true /p:PublishProfile=FolderProfile'
-
Publish the artifact to azure pipeline by adding this another task to the yaml file:
- task: PublishPipelineArtifact@1 inputs: targetPath: '$(Build.Repository.LocalPath)\MyPortal\bin\app.publish' artifact: 'My portal' publishLocation: 'pipeline'