Azure Pipeline Publish .NET Artifact to Web App

This Azure Pipeline blog post will show you how to create and publish a .NET app into an artifact and deploy it to an Azure Web App, App Service.

Azure Pipelines allow us to build, test and deploy .NET applications to a Web App in a single pipeline which is very handy for small deployments.

In our case, we are using the AzureRmWebAppDeployment and the DotNetCoreCLI tasks to create an artifact from a .NET build and publish it directly to an existing Azure Web App.

Azure Pipeline

To use the tasks below, Add your Azure tenant details and run the job.

- task: DotNetCoreCLI@2
  displayName: 'Publish Artifact $(buildConfiguration)'
    command: publish
    publishWebProjects: True
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: True    

- task: AzureRmWebAppDeployment@4
     ConnectionType: 'AzureRM'
     azureSubscription: 'SUN-NAME'
     appType: 'webApp'
     WebAppName: 'APPNAME'
     deployToSlotOrASE: true
     ResourceGroupName: 'RGNAME'
     SlotName: 'production'
     packageForLinux: '$(Build.ArtifactStagingDirectory)/**/*.zip'

Success! You're on the list.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.