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: [email protected]
  displayName: 'Publish Artifact $(buildConfiguration)'
  inputs:
    command: publish
    publishWebProjects: True
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: True    

- task: [email protected]
  inputs:
     ConnectionType: 'AzureRM'
     azureSubscription: 'SUN-NAME'
     appType: 'webApp'
     WebAppName: 'APPNAME'
     deployToSlotOrASE: true
     ResourceGroupName: 'RGNAME'
     SlotName: 'production'
     packageForLinux: '$(Build.ArtifactStagingDirectory)/**/*.zip'

Processing…
Success! You're on the list.

Leave a comment

Your email address will not be published. Required fields are marked *

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