Functions not visible when deploy with Prisma ORM
Abhishek Akbari
0
Reputation points
I have one backend with azure functions. When I do the deployment using CI/CD the functions are not visible on azure portal even if deployment get successful. I am having Prisma ORM in my functions.
When I remove prisma related stuff and deploy without prisma, I am able to see the functions on the azure portal. There is something wrong while we deploy with prisma. I need solution for this.
Here is below my workflow code:-
name: Deploy Node.js project to Azure Function App
on:
push:
branches:
- dev # Adjust to your main development branch
env:
AZURE_FUNCTIONAPP_NAME: 'my-function-app' # Azure Function App name
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # Path to function app
NODE_VERSION: '20.x' # Node.js version
jobs:
build-and-deploy:
runs-on: windows-latest
environment: dev
steps:
- name: 'Checkout repository'
uses: actions/checkout@v4
- name: 'Set up Node.js ${{ env.NODE_VERSION }}'
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: 'Install dependencies'
run: npm ci
- name: 'Install Prisma CLI'
run: npm install --save-dev prisma
- name: 'Generate Prisma Client'
run: npx prisma generate
- name: 'Apply database migrations'
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
run: npx prisma migrate deploy
- name: 'Clean up node_modules (reduce size)'
run: |
Remove-Item -Path "node_modules/.cache" -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item -Path "prisma/migrations" -Recurse -Force -ErrorAction SilentlyContinue
- name: 'Build project'
run: npm run build --if-present
- name: 'Reinstall production dependencies'
run: npm ci --omit=dev --ignore-scripts # Ensures only production dependencies are deployed
- name: 'Deploy to Azure Functions'
uses: Azure/functions-action@v1
id: fa
env:
ACTIONS_STEP_DEBUG: true # Verbose logging
with:
app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }}
package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
publish-profile: ${{ secrets.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }}
I want more better solution to deploy azure functions with Prisma ORM.
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
Sign in to answer