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?

Add Comment
1 Answer(s)

Found a solution by automatically run publish on build. The steps are:

  1. Create a publish to folder profile, name FolderProfile.

    I used the defaults that point to a target path at bin\app.publish

  2. 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' 
  3. 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' 
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.