Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ASP.NET 5 deployment script to publish with --no-source and --configuration Release #28

Open
DamianEdwards opened this issue Aug 10, 2015 · 7 comments

Comments

@DamianEdwards
Copy link

Make Kudu deployment script publish with --no-source --configuration Release so app doesn’t have to compile on startup and is compiled with optimizations.

@davidebbo
Copy link
Member

Should we make this configurable, so that users can go either way?

@DamianEdwards
Copy link
Author

Sounds good. What does that mean exactly? An env var to control? Portal option?

@davidebbo
Copy link
Member

Well, it could be either, depending on whether it's an edge case of something common.

Interestingly, it looks like @ahmelsayed already added a switch. Looking at this line, if you set a SCM_DNU_PUBLISH_OPTIONS env variable, it gets appended to the command line.

Not saying this is necessarily good enough, but it should at least allow you to test the scenario with the other flags, to validate that you get the expected improvements and that everything works. Can you try setting SCM_DNU_PUBLISH_OPTIONS=--no-source --configuration Release in the portal before deploying and see how that goes?

@hoetz
Copy link

hoetz commented Sep 14, 2015

I just set SCM_DNU_PUBLISH_OPTIONS to --configuration Release but after deploying to Azure via github my app is broken as long as I have

#if DEBUG
.AddJsonFile("secret.json") //only for debug, use Azure env. vars when deployed
#else

in my Startup.cs

@davidfowl
Copy link
Member

Side question: Why are you switching on debug instead of the environment?

@hoetz
Copy link

hoetz commented Sep 15, 2015

Because I didn't know any better :)
Will take a look at this now: http://docs.asp.net/en/latest/fundamentals/environments.html

@hoetz
Copy link

hoetz commented Nov 18, 2015

This is still breaking my site (rc1-final) when publishing to Azure:

      var ConfigurationBuilder = new ConfigurationBuilder().SetBasePath(appEnv.ApplicationBasePath);

        if (env.IsDevelopment())
        {
            ConfigurationBuilder
                .AddJsonFile("secret.json");
        }
        else
        {
            ConfigurationBuilder
      .AddEnvironmentVariables();
        }

System.IO.FileNotFoundException
The configuration file 'D:\home\site\approot\src\Web\secret.json' was not found and is not optional.
Update: Setting SCM_DNU_PUBLISH_OPTIONS = --configuration Release did not help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants