In Azure DevOps we have the following Azure App Service deploy task in our release pipeline:
This works good but it adds Application settings
WEBSITE_RUN_FROM_PACKAGE = 1
for Azure App Service
The web application starts but for some reason /lib/ionic/release/css/ionic.min.css
is not loaded with this setting.
If I remove WEBSITE_RUN_FROM_PACKAGE
and upload the exact same files via FTP everything works as expected.
I know WEBSITE_RUN_FROM_PACKAGE
comes from the .zip file deployment but is there anyway to modify the task to simply upload a folder or do I need to use the FTP upload
task then? I know WEBSITE_RUN_FROM_PACKAGE
makes wwwroot read-only but what could be causing this? With this setting a GET to the resource simple gives the following error:
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
https://learn.microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package
Solved the upload with FTP Upload task
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/ftp-upload?view=azure-devops
However after doing this I still had the same error.
Went into App Service Console and there I could not see the file at all.
I finally solved it by looking at the file name, /lib/ionic/release/css/ionic.min.css
. In our .gitignore
file we exclude [Rr]elease/
. Adding a ignore with !AppFolder/**
solved it so the files were added to git.