How to deploy Linux Function with SCM_DO_BUILD_DURING_DEPLOYMENT option

Ricardo de Vries 1 Reputation point
2022-10-25T19:58:36.267+00:00

I'm trying to deploy an Azure Functions Linux app using Github Actions. I've used the Deployment Center in the Azure Portal to connect my Github to enable CICD. Now that goes fine, but I want to use Playwright in my Azure Function, so I need to enable scm-do-build-during-deployment: true. I've added this setting to my workflow yaml, but then the deployment doesn't work anymore. I also added some other settings, which I came across when I searched the interwebs. Now this is the yaml I have:

   # Docs for the Azure Web Apps Deploy action: https://github.com/azure/functions-action  
   # More GitHub Actions for Azure: https://github.com/Azure/actions  
     
   name: Build and deploy Node.js project to Azure Function App - app-name  
     
   on:  
     push:  
       branches:  
         - main  
     workflow_dispatch:  
     
   env:  
     AZURE_FUNCTIONAPP_PACKAGE_PATH: "." # set this to the path to your web app project, defaults to the repository root  
     NODE_VERSION: "16.x" # set this to the node version to use (supports 8.x, 10.x, 12.x)  
     
   jobs:  
     build-and-deploy:  
       runs-on: ubuntu-latest  
       steps:  
         - name: "Checkout GitHub Action"  
           uses: actions/checkout@v2  
     
         - name: Setup Node ${{ env.NODE_VERSION }} Environment  
           uses: actions/setup-node@v1  
           with:  
             node-version: ${{ env.NODE_VERSION }}  
     
         - name: "Resolve Project Dependencies Using Npm"  
           shell: bash  
           run: |  
             pushd './${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'  
             npm install  
             npm run build --if-present  
             npm run test --if-present  
             popd  
     
         - name: "Run Azure Functions Action"  
         uses: Azure/functions-action@v1  
           id: fa  
           with:  
             app-name: "app-name"  
             slot-name: "Production"  
             package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}  
             publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_A5413AC6097F4B21B4A709C270747826 }}  
             scm-do-build-during-deployment: true  
             enable-oryx-build: true  
             respect-funcignore: true  

I also added the setting to my application settings in Azure, but to no avail. Furthermore, I added this setting: WEBSITE_RUN_FROM_PACKAGE=0 to the app settings.

Is there anything else I should try?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,519 questions
{count} votes