locked
Azure DevOps deployment issue RRS feed

  • Question

  • I have a Functions v2.0 Core function in Azure DevOps repo, created a Build pipeline for it using the yaml file (copied below) which basically builds the code, creates the archive and then finally publishes it. Then I have a Release pipeline where I use 'Azure App Service Deploy' to deploy the function using the zip file published from the Build pipeline. 

    It all works fine, Build succeeds, Release pipeline picks it up and completes the deploy task successfully but the problem is I don't see anything deployed in the Function App, no function inside it, it remains empty, I can see in the 'App Service Editor' that it has deployed the files but maybe they are not what the Function App is looking for, I am new to Azure DevOps & yaml files, can you please tell me what could be possibly going wrong?

    My Yaml File

    pool:
      vmImage: 'vs2017-win2016'

    variables:
      buildConfiguration: 'Release'

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

      - task: ArchiveFiles@2
        displayName: "Archive files"
        inputs:
          rootFolderOrFile: "$(System.DefaultWorkingDirectory)"
          includeRootFolder: false
          archiveFile: "$(System.DefaultWorkingDirectory)/$(Build.BuildId).zip"

      - task: PublishBuildArtifacts@1
        inputs:
          PathtoPublish: '$(System.DefaultWorkingDirectory)'
          name: 'drop'

    Release Pipeline

    



    • Edited by Syed_Sajid Monday, October 29, 2018 9:45 AM App Service Editor
    Sunday, October 28, 2018 4:19 PM

Answers

  • Actually, by default it takes you to use the 'Yaml pipeline' but on the first page, there's a little link you can use to do it in 'Visual Designer', I missed that and thought Yaml was the only option. It's pretty easy using the designer as you just use the 'ASP.Net Core' Build template to Build and Publish and it takes care of publishing artifacts in the right format and structure required by the Release pipeline. That solved my problem! 


    • Edited by Syed_Sajid Thursday, November 1, 2018 12:49 PM grammar
    • Marked as answer by Syed_Sajid Thursday, November 1, 2018 12:49 PM
    Thursday, November 1, 2018 12:48 PM

All replies

  • Hi Syed,

    I think the issue here may be related to the "Package or folder" directory that is specified. This appears to be a default value that needs to be changed.

    Can you please change the path to $(build.artifactstagingdirectory)/**/*.zip to see if that makes a difference?

    For your reference, this is mentioned in the following blog on deploying Azure Functions using DevOps (formerly known as VSTS): https://blogs.msdn.microsoft.com/appserviceteam/2017/06/01/deploying-visual-studio-2017-function-projects-with-vsts/

    If this answer was helpful, click “Mark as Answer” or Up-Vote. To provide additional feedback on your forum experience, click Here

    Wednesday, October 31, 2018 8:06 AM
  • Hey Syed_Sajid - Any updates on this?
    Wednesday, October 31, 2018 9:26 PM
  • Actually, by default it takes you to use the 'Yaml pipeline' but on the first page, there's a little link you can use to do it in 'Visual Designer', I missed that and thought Yaml was the only option. It's pretty easy using the designer as you just use the 'ASP.Net Core' Build template to Build and Publish and it takes care of publishing artifacts in the right format and structure required by the Release pipeline. That solved my problem! 


    • Edited by Syed_Sajid Thursday, November 1, 2018 12:49 PM grammar
    • Marked as answer by Syed_Sajid Thursday, November 1, 2018 12:49 PM
    Thursday, November 1, 2018 12:48 PM