Base solution for your next web application
Open Closed

Azure production release, angular - appsettings.json renamed to appsettings.production.json #6821


User avatar
0
BobIngham created

angular, dotnetcore, 6.8.0, .net 4.6.1 I recently upgraded from 5.4.1 to 6.8.0 and released this version to Azure production tonight. I was getting errors in the angular project and noticed, in Chrome's network tab, that the angular UI was trying to download appconfig.production.json. I had followed the instructions for release carefully (though they have not changed dramatically) by deleting everything in my web site folder leaving behind web.config in my root and a folder called assets with the appconfig.json file. I then uploaded everything from my dist folder having built the system with:

node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod =true --optimization=true --aot

Note - my system will not compile without the prefixed node command to limit memory. Having deployed everything I had to stop the service in Azure and rename the appconfig.json file to appconfig.production.json. The system then worked.

Is this expected behaviour? Has something changed in the documentation which I have missed?

I have looked around the code base to see what's changed but I'm at a loss for why this would occur.

Any ideas anyone?


3 Answer(s)
  • User Avatar
    0
    BobIngham created

    If I stay with appconfig.json I get:

    ERROR SyntaxError: Unexpected token < in JSON at position 0
        at JSON.parse (<anonymous>)
    
  • User Avatar
    0
    aaron created
    Support Team

    It was changed in v5.5 (June 2018) to Allow using appconfig.json for different environments (commit 580d2bb).

    That file is included in ASP<span></span>.NET Zero source code and should have been added to your solution during your upgrade.

    It is specified in environment.prod.ts.

  • User Avatar
    0
    BobIngham created

    I really must learn to upgrade more often and pay careful attention to the release notes. Thanks again, Aaron.