title: Azure Pipeline Publish: task DotNetCoreCLI with specific folder or project
body: <p>I'm having a problem (unwanted behavior) when running an Azure Build Pipeline with the following project/folder structure.</p>
  
  <p>My repository's root folder has two main folders: </p>
  
  <ul>
  <li>frontend (ASP.Net Core 2.x &amp; Angular 7 project)</li>
  <li>backend (ASP.Net Core 2.x)</li>
  </ul>
  
  <p>I'm trying to build two separate Azure Pipelines one for the backend and one for the frontend, so I use the <code>projects:</code> parameter to specify the correct path.</p>
  
  <p>The <code>build</code> and <code>test</code> commands are running fine and are only restoring/building/testing the <code>backend</code> folder, but the <code>publish</code> command is running for both folders: backend &amp; frontend.</p>
  
  <p>This is my yaml file:</p>
  
  <pre><code> #build backend project
   task: DotNetCoreCLI@2
     displayName: dotnet build --configuration $(buildConfiguration)
     name: BuildBackendProject
     inputs:
       command: build
       projects: '**/backend/**/*.csproj'
       arguments: '--configuration $(buildConfiguration)'
  
   ... #run some tests
  
   #publish backend project
   task: DotNetCoreCLI@2
     displayName: dotnet publish backend --configuration $(buildConfiguration)
     name: PublishBackendProject
     inputs:
       command: publish
       projects: '**/backend/**/*.csproj'
       publishWebProjects: True
       arguments: '--configuration $(BuildConfiguration) --output 
       $(Build.ArtifactStagingDirectory)/backend'
       zipAfterPublish: True
  </code></pre>
  
  <p>I tried different folder paths but it's always running two publish commands.</p>
  
  <p>If I run locally in CMD <code>dotnet publish backend</code> (from repo's root folder) it works fine but apparently that doesn't work with the Azure Pipeline.</p>
  
  <p>Any ideas or fixes greatly appreciated.</p>