Share via

How to do Azure functions deployment for node app in azure pipeline yml?

Mikko Eronen 1 Reputation point
2021-12-29T07:30:35.343+00:00

I have a working build job. It builds a few different function apps written in node js. It is very simple to deploy these using visual studio code, but I cannot fathom how to write a working deployment job for this in devops pipelines yml.

I think one way has to be archiving my 'dist' folder after building and somehow offering the archive to e.g. 'AzureFunctionApp@1' task.

Am I on a correct path? It seems I cannot find definite answer from documentation.

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Mikko Eronen 1 Reputation point
    2021-12-29T09:05:09.26+00:00

    I figured out that I was on the right track. The problem was that the stages did not share visibility on the archive. So I got to get forward by publishing the archive so that the build stage could download it. I also noticed that I can skip the archiving and just publish the dist folder.

    ## In the build stage: 
        - publish: './dist'
                artifact: distFolder
    
    ## In the deploy stage:
              - download: current
                artifact: distFolder
    
              - task: AzureFunctionApp@1
              ...
    

    One further question though. Is there a way to do the pipeline deployment without package file?

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.