<p>Lets take this line by line:</p>

<p>My additions are added as comments.</p>

<pre><code>trigger:
- master
# The branch you are building.

pool:
  vmImage: 'Ubuntu-16.04'
# The type of VM your code will run on.

variables:
  buildConfiguration: 'Release'
#This ends up defining which webconfig file to use.

steps:
- script: dotnet restore
  displayName: Restoring Dependencies

- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'
# Builds your application
- task: DotNetCoreCLI@2
  displayName: Unit Tests
  inputs:
    command: test
    projects: '**/*Tests/*.csproj'
    arguments: '--configuration $(buildConfiguration)'
#Runs unit tests for your application
- task: DotNetCoreCLI@2
  displayName: Publishing
  inputs:
    command: publish
    publishWebProjects: True
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: True
#Pushes your application as an artifact (You'll be able to see it in your list of artifacts in Azure DevOps)
- task: PublishBuildArtifacts@1
</code></pre>

<p>As for your release script, you are forgetting to pass in the values so your release script isn't doing anything at the moment.
But when it does work, it will take the objects from your artifacts or container images and deploy them into your webapp the same way it would do it if you ran those commands from your local machine.</p>

CC BY-SA 4.0
2019-03-17T09:24:31.293Z
Hi thanks for the answer - what is the difference between `DotNetCoreCLI@2 Publish` and `PublishBuildArtifacts@1`. Also, there is nothing in  "Artifacts" in Azure Devops... I don't know why - or where the release pipeline gets the files it needs from as it is working - the release is successful - I have a site I can navigate to.
Percy
CC BY-SA 4.0
2019-03-17T12:21:32.953Z
You probably don't have any artifacts getting built, so you don't see the difference. Publish is creating the docker image and pushing it. Build artifacts would be creating artifacts and putting them into the artifacts section if there were any artifacts to build.
avi
CC BY-SA 4.0
2019-03-16T21:00:46.047Z
2019-03-16T21:00:46.047Z
avi
<p>First to answer the difference between DotNetCoreCLI@2 Publish and PublishBuildArtifacts@1</p>
<p>In DotNetCoreCLI@2 Publish task you are only publishing your build output\ files built by your code to $(Build.ArtifactStagingDirectory) which is a predefined variable for the build artifact location. This need not even be $(Build.ArtifactStagingDirectory). Here you are just telling the build pipeline where to place the files built from your code.</p>
<p>In PublishBuildArtifacts@1 task, it lets you publish your $(Build.ArtifactStagingDirectory) or your built binaries (if generated elsewhere) or even your source code to a file share or Azure pipelines. Basically PublishBuildArtifacts@1 is also what defines the content or artifact that gets passed to your release pipleline from your build pipeline.</p>
<p>Hope this answers the question.If not the below documentation from microsoft should.</p>
<p><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#publish" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#publish</a></p>
<p><a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/publish-build-artifacts?view=azure-devops" rel="nofollow noreferrer">Publish Build Artifacts</a></p>

CC BY-SA 4.0
2022-02-09T11:03:29.240Z
2022-02-09T11:03:29.240Z
Jerry
<p>I'm finding the Azure devops documentation pretty poor - or maybe I'm just not familiar enough with it for it to make any kind of sense to me. Having said that, I've managed to create a build pipeline that runs tests and published my project, then I created a release pipeline and have successfully released to an Azure App Service.</p>

<p>However, I honestly don't know what is happening behind the scenes...</p>

<p>I have this build pipeline yaml:</p>

<pre><code># ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
  vmImage: 'Ubuntu-16.04'

variables:
  buildConfiguration: 'Release'

steps:
- script: dotnet restore
  displayName: Restoring Dependencies

- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: Unit Tests
  inputs:
    command: test
    projects: '**/*Tests/*.csproj'
    arguments: '--configuration $(buildConfiguration)'

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

- task: PublishBuildArtifacts@1
</code></pre>

<p>I'm not sure if I need both the <code>DotNetCoreCLI@2</code> and <code>PublishBuildArtifacts@1</code> publishing tasks. Are they doing the same thing? Where are the files being published to? Can I see them?</p>

<p>And I've created a Release Pipeline where artifacts points at the above release pipeline:</p>

<pre><code>#Your build pipeline references an undefined variable named ‘Parameters.ConnectedServiceName’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references an undefined variable named ‘Parameters.WebAppKind’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references an undefined variable named ‘Parameters.WebAppName’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972

steps:
- task: AzureRmWebAppDeployment@4
  displayName: 'Deploy Azure App Service'
  inputs:
    azureSubscription: '$(Parameters.ConnectedServiceName)'
    appType: '$(Parameters.WebAppKind)'
    WebAppName: '$(Parameters.WebAppName)'
</code></pre>

<p>How is the release pipeline moving the files to the Azure App Service, and can I look to see what is going to the App Service?</p>

<p>Bit of a noob with devops as you might have guessed</p>

CC BY-SA 4.0
2019-06-10T02:20:45.937Z
I agree I find the doco very obtuse. I think perhaps it assumes some prior knowledge in other tools. It may be enlightening to add a variable called debug and set it to true. This makes output verbose. It becomes a bit more obvious what all those mystery unexplained folders appearing in your error messages are. Really I was expecting a lot more from this tool. It seems to me that building pipelines requires a lot of hooking up steps with these opaque incantations
Nick.Mc
<azure><azure-devops><azure-pipelines>
What is happening in an Azure Devops build and release?
Percy
# What is happening in an Azure Devops build and release?

(Asked by: username_0 on 2019-03-16)

I'm finding the Azure devops documentation pretty poor - or maybe I'm just not familiar enough with it for it to make any kind of sense to me. Husername_2ng said that, I've managed to create a build pipeline that runs tests and published my project, then I created a release pipeline and have successfully released to an Azure App Service.
However, I honestly don't know what is happening behind the scenes...
I have this build pipeline yaml:
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
  vmImage: 'Ubuntu-16.04'

variables:
  buildConfiguration: 'Release'

steps:
- script: dotnet restore
  displayName: Restoring Dependencies

- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'

- task: DotNetCoreCLI@2
  displayName: Unit Tests
  inputs:
    command: test
    projects: '**/*Tests/*.csproj'
    arguments: '--configuration $(buildConfiguration)'

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

- task: PublishBuildArtifacts@1

I'm not sure if I need both the DotNetCoreCLI@2 and PublishBuildArtifacts@1 publishing tasks. Are they doing the same thing? Where are the files being published to? Can I see them?
And I've created a Release Pipeline where artifacts points at the above release pipeline:
#Your build pipeline references an undefined variable named ‘Parameters.ConnectedServiceName’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references an undefined variable named ‘Parameters.WebAppKind’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972
#Your build pipeline references an undefined variable named ‘Parameters.WebAppName’. Create or edit the build pipeline for this YAML file, define the variable on the Variables tab. See https://go.microsoft.com/fwlink/?linkid=865972

steps:
- task: AzureRmWebAppDeployment@4
  displayName: 'Deploy Azure App Service'
  inputs:
    azureSubscription: '$(Parameters.ConnectedServiceName)'
    appType: '$(Parameters.WebAppKind)'
    WebAppName: '$(Parameters.WebAppName)'

How is the release pipeline moving the files to the Azure App Service, and can I look to see what is going to the App Service?
Bit of a noob with devops as you might have guessed

**Tags:** azure, azure-devops, azure-pipelines

> **Comments:**
> **username_1**: I agree I find the doco very obtuse. I think perhaps it assumes some prior knowledge in other tools. It may be enlightening to add a variable called debug and set it to true. This makes output verbose. It becomes a bit more obvious what all those mystery unexplained folders appearing in your error messages are. Really I was expecting a lot more from this tool. It seems to me that building pipelines requires a lot of hooking up steps with these opaque incantations  

---

## 2 answers

### Answer by username_2 on 2019-03-16. Score: 1

Lets take this line by line:
My additions are added as comments.
trigger:
- master
# The branch you are building.

pool:
  vmImage: 'Ubuntu-16.04'
# The type of VM your code will run on.

variables:
  buildConfiguration: 'Release'
#This ends up defining which webconfig file to use.

steps:
- script: dotnet restore
  displayName: Restoring Dependencies

- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'
# Builds your application
- task: DotNetCoreCLI@2
  displayName: Unit Tests
  inputs:
    command: test
    projects: '**/*Tests/*.csproj'
    arguments: '--configuration $(buildConfiguration)'
#Runs unit tests for your application
- task: DotNetCoreCLI@2
  displayName: Publishing
  inputs:
    command: publish
    publishWebProjects: True
    arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: True
#Pushes your application as an artifact (You'll be able to see it in your list of artifacts in Azure DevOps)
- task: PublishBuildArtifacts@1

As for your release script, you are forgetting to pass in the values so your release script isn't doing anything at the moment.
But when it does work, it will take the objects from your artifacts or container images and deploy them into your webapp the same way it would do it if you ran those commands from your local machine.

> **Comments:**
> **username_0**: Hi thanks for the answer - what is the difference between `DotNetCoreCLI@2 Publish` and `PublishBuildArtifacts@1`. Also, there is nothing in  "Artifacts" in Azure Devops... I don't know why - or where the release pipeline gets the files it needs from as it is working - the release is successful - I have a site I can nusername_2gate to.  
> **username_2**: You probably don't have any artifacts getting built, so you don't see the difference. Publish is creating the docker image and pushing it. Build artifacts would be creating artifacts and putting them into the artifacts section if there were any artifacts to build.  

---

### Answer by username_3 on 2022-02-09. Score: 0

First to answer the difference between DotNetCoreCLI@2 Publish and PublishBuildArtifacts@1

In DotNetCoreCLI@2 Publish task you are only publishing your build output\ files built by your code to $(Build.ArtifactStagingDirectory) which is a predefined variable for the build artifact location. This need not even be $(Build.ArtifactStagingDirectory). Here you are just telling the build pipeline where to place the files built from your code.

In PublishBuildArtifacts@1 task, it lets you publish your $(Build.ArtifactStagingDirectory) or your built binaries (if generated elsewhere) or even your source code to a file share or Azure pipelines. Basically PublishBuildArtifacts@1 is also what defines the content or artifact that gets passed to your release pipleline from your build pipeline.

Hope this answers the question.If not the below documentation from microsoft should.

<https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#publish>

[Publish Build Artifacts](https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/publish-build-artifacts?view=azure-devops)


---

