title: Pipeline to deploy Net Core 3.1 webapp project and Azure Function App project
body: <p>In my current solution, I have two projects: A <code>Net Core 3.1 MVC</code> project and an <code>Azure Function App</code> project. Both are hosted in Azure, but in different resources (Webapp in an AppService, and the Function App project has its own Function App resource.</p>
  <pre><code>-SolutionName
   |_ WebApp Project
   |_ WebApp.AzureFunction project
  </code></pre>
  <p>In my current Azure DevOps pipeline, I have defined a build and deploy for the webapp only. How can I add a step that will take only the Azure Function App and deploys it to its respective resource?</p>
  <p>EDIT: Based on the answer below, I have edited the yaml. The pipeline succeeds, but the zip for the azure function is empty.</p>
  <p>My current yaml file looks like this:</p>
  <pre><code># vm-image, variables, building of webapp removed for brevity.           
  steps:
  - task: DotNetCoreCLI@2
    displayName: 'Build Project Azure Function: WebApplicationTest.AzFunction'
    inputs:
      projects: 'WebApplicationTest.AzFunction.PipelineTest/*.csproj'
      arguments: '--output $(System.DefaultWorkingDirectory)/publish_output --configuration Release'
      zipAfterPublish: false
  
  - task: ArchiveFiles@2
    displayName: 'Archive Azure Function'
    inputs:
      rootFolderDirectory: '$(System.DefaultWorkingDirectory)/publish_output/'
      includeRootFolder: false
      ArchiveFile: '$(Build.ArtifactStagingDirectory)/functions/azfunction.zip'
      replaceExistingArchive: true
  
  - task: PublishBuildArtifacts@1
    displayName: 'Publish Azure Function: WebApplicationTest.AzFunction.PipelineTest'
    inputs:
      pathtoPublish: '$(Build.ArtifactStagingDirectory)/functions'
      ArtifactName: 'functions'
  
  #Deploy different artifact to different resources
  
  # Deploy webapp step removed for brevity.
  
  - task: AzureFunctionApp@1
    displayName: Deploy to Azure Function
    inputs:
      azureSubscription: $(azureSubscription)
      appType: functionApp
      appName: 'WebApplicationTest-AzFunction-PipelineTest'
      package: '$(Pipeline.Workspace)/**/azfunction.zip'
  </code></pre>
  <p>I think it needs another step and then take the Azure Function App project from the <code>$(Build.ArtifactStagingDirectory)</code> package, and deploy it to my Function App resource. What is the best way to do this?</p>