Thanks for the suggestion. However, we did not need to test it out as, fortunately for us, the issue resolved itself after we tried creating a new F1 tier Linux Web App resource without any Settings, where the Kudu build system took over the deployment and worked just fine without any config by unpacking the zip artifact and running it.
I'd like to note some other features of our setup that might have affected the behaviour of Oryx (might be useful for people that encounter similar problem, or for Azure maintainers who will look into the issue of Oryx being ignorant to env variables):
- The service was first created as a B1 tier instance
- Subsequently, the pipeline settings (Github Actions) were set at service creation time, and we used the .yml config file for actions that Azure has automatically created for us.
Also, I want to share our Github Action responsible for deployment in case somebody finds it useful, as it allows to fit a simple Next.js app into a F1 Tier instance regardless of whether an excessive npm i + npm run build
step occurs or not (i.e. whether it is Oryx or Kudu that deploys the code):
name: Build and deploy Node.js app to Azure Web App - ***
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: '>=18.12.0' # Requirement in our case, may be different in yours
- name: Build in standalone mode
working-directory: ./<work_dir_name>
env: # Github repo secrets
NEXT_PUBLIC_SUPABASE_URL: ${{ secrets.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ secrets.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
run: |
CI=true npm install
npm run build
- name: Copy non-source files into the standalone build folder
working-directory: ./<work_dir_name>
run: |
cp -r public .next/standalone/public
cp -r .next/static .next/standalone/.next/static
# AS it is currently impossible to alter the behaviour of Web App builder, it is necessary to remove Dev- and build-time-specific scripts as they will crash in CI, and remove devDeps to make the final release slimmer.
- name: Modify standalone build package.json
working-directory: ./<work_dir_name>/.next/standalone
run: |
npm pkg delete scripts.postinstall scripts.prepare devDependencies
npm pkg set scripts.start="node server.js" scripts.build="echo \"Using results of a pipeline build\" "
- name: Zip standalone folder into a deployment artifact
working-directory: ./<work_dir_name>
run: cd .next/standalone && zip ../../release.zip * .next -qr
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: node-app
path: ./<work_dir_name>/release.zip
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: node-app
- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: *** # Your app name in Azure
slot-name: *** # Most likely 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_*** }}
package: release.zip
- name: Artifact cleanup
run: rm release.zip