I have a legacy ASP.NET WebForms application that's deployed in an Azure App Service.
I'd like to set the debug value of <compilation debug="xxx"> using an environment variable. For example, the debug environment variable in the Azure App Service would get set to true (prod) and locally to false (dev).
The app is deployed to the App Service via a Git repository hosted on BitBucket.
I'm aware that the usual way of doing this is with two Web.config files (.release and .debug) and using transforms. But this app gets deployed when the code is pushed to a BitBucket repository, not through a build in Visual Studio.
Is there any way to do this with an environment variable, or even external file (e.g., similar to how appSettings can be pulled into a Web.config file using the file attribute)?