I am deploying our NodeJS application to our Azure App service using Azure's local git. What I am basically doing is making our CICD pipeline git commit our changes and do a force push to Azure's Local Git. Then, Azure will build the application from the committed files, which seems to be working fine.
But today, I have made a shocking discovery, after couple of weeks of deployment, the files in the wwwroot
folder does not match the files in the Local Git Repo. The files that do not exist anymore in the Local Git repo are still in the wwwroot
folder
For example, the git repo contains the following files under prisma/migrations
But in the Azure App service wwwroot
folder, the same directory contains more than that:
So, these files are actually from previous deployments that do not exist in the latest version of the master
branch of the Local Git.
Upon looking at their deployment step, I learned that they are simply copying whatever files are created in their deployment "Oryx/Kudu" deployment step into the wwwroot
folder without checking if there should be files needed to be deleted:
If this is the case with this approach, is there a proper way to do this?
Or is there a quick way to clean the existing wwwroot
folder first before their deployer copy the files?
Hope somebody can help.
Thanks!