← Back to Articles         
Deploy ASP.NET Core Application to Azure App Service

Deploy ASP.NET Core Application to Azure App Service

Published on 08 Oct 2026     3 min read Azure DevOps
Deployment / CD Pipeline

Deploy ASP.NET Core Application to Azure App Service Using Azure Pipelines

1. What is it?

Azure Pipelines automatically builds, tests, publishes, and deploys an ASP.NET Core application to Azure App Service.

  • Azure Pipelines: Automates the CI/CD process.

  • Azure App Service: Hosts and runs the ASP.NET Core application.

  • Service Connection: Allows Azure DevOps to securely access Azure resources.

2. How does it work?

Developer
    |
    | Commit & Push Code
    v
Azure Repos / GitHub
    |
    | Trigger CI Pipeline
    v
Azure Pipelines
    |
    | dotnet restore
    | dotnet build
    | dotnet test
    | dotnet publish
    v
Build Artifact (ZIP)
    |
    | Deployment Stage
    v
Azure Service Connection
    |
    | AzureWebApp@1 Task
    v
Azure App Service
    |
    v
ASP.NET Core Application Running

3. Deployment steps

  1. Developer pushes ASP.NET Core code to Git.

  2. Azure Pipeline automatically starts.

  3. Pipeline restores dependencies, builds and tests the application.

  4. dotnet publish generates deployable files.

  5. Pipeline packages the published files into a ZIP artifact.

  6. Deployment stage uses an Azure Service Connection.

  7. AzureWebApp@1 deploys the ZIP package to Azure App Service.

  8. Azure App Service runs the application.

4. Simple YAML example

Assume the build artifact is already generated as webapp.zip.

- task: AzureWebApp@1
  displayName: 'Deploy ASP.NET Core App'
  inputs:
    azureSubscription: 'MyAzureServiceConnection'
    appType: 'webApp'
    appName: 'my-aspnetcore-app'
    package: '$(Pipeline.Workspace)/drop/webapp.zip'

Explanation:

Property

Purpose

AzureWebApp@1

Azure App Service deployment task

azureSubscription

Azure Service Connection name

appType

Web App type (webApp for Windows)

appName

Azure App Service name

package

Location of the published ZIP artifact

The ZIP must first be downloaded or made available to the deployment job at the specified path.

5. Important interview points

  • CI Pipeline: Restore → Build → Test → Publish → Artifact.

  • CD Pipeline: Download Artifact → Deploy to Azure App Service.

  • Service Connection: Provides secure authentication to Azure.

  • Deployment Slots: Support staging and production deployments with slot swapping.

  • App Settings: Configure environment-specific values such as connection strings.

  • Rollback: Can be performed by redeploying a previous artifact or using deployment slots.

6. Interview answer

Question: How do you deploy an ASP.NET Core application to Azure App Service using Azure Pipelines?

Answer:

"We use Azure Pipelines to automate our ASP.NET Core application deployment. When developers push code to Git, the CI pipeline restores dependencies, builds, tests, and publishes the application.

The published output is stored as a build artifact. The CD stage downloads this artifact and uses the AzureWebApp task with an Azure Service Connection to deploy it to Azure App Service.

We also manage environment-specific configurations through App Service settings and use deployment slots when required for safer production deployments."

Remember: CI builds the application, CD deploys it, and Azure App Service hosts it.

← Back to Articles