Search code examples
azureazure-devopsazure-web-app-serviceazure-devops-pipelines

Azure DevOps - Azure App Service deploy - Adds Application settings WEBSITE_RUN_FROM_PACKAGE causes CSS to not load


In Azure DevOps we have the following Azure App Service deploy task in our release pipeline:

enter image description here

This works good but it adds Application settings WEBSITE_RUN_FROM_PACKAGE = 1 for Azure App Service

enter image description here

The web application starts but for some reason /lib/ionic/release/css/ionic.min.css is not loaded with this setting.

enter image description here

If I remove WEBSITE_RUN_FROM_PACKAGE and upload the exact same files via FTP everything works as expected.

enter image description here

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


Solution

  • Solved the upload with FTP Upload task

    https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/ftp-upload?view=azure-devops

    enter image description here

    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.

    enter image description here

    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.