I have a solution containing an Web App and Web Job project, that I build and deploy with Azure DevOps pipelines, which I deploy to an Azure Windows App Service, using the ZipDeploy option. I can deploy the Web App to my DEV and TEST environments with no problem using my Release Pipeline. When I use the same Release Pipeline to Deploy to my PROD environment, the WEBSITE_RUN_FROM_PACKAGE =1
environment variable mysteriously appears as an Environment Variable. This setting is NOT in my appsettings.json file, or even my User Secrets file. I have compared the 3 Stages of the Release Pipeline and see no differences (other than the environment Subscription and the App Service name).
I have a second similar solution, with a Web App and 2 Web Jobs projects, which Deploys correctly across all 3 environments. I have compared the Build and Release Pipelines from these 2 DevOps projects and can see no differences.
I can use Kudu to view the appsettings.json files in the App Service file system, and there is no WEBSITE_RUN_FROM_PACKAGE
entry in them. Kudu also shows WEBSITE_RUN_FROM_PACKAGE = 1
and APPSETTING_WEBSITE_RUN_FROM_PACKAGE = 1
in the Environment page -> Environment Variables section. Also, I will swear that I manually deleted the WEBSITE_RUN_FROM_PACKAGE =1
environment variable from the App Service Portal, only to have it reappear some time later, which makes no sense at all.
Where could this Environment Variable be coming from?