projectkudu / kudu

Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites. It can also run outside of Azure.
Apache License 2.0
3.12k stars 654 forks source link

Is there any way to change website appsettings during custom deployment script? #1844

Closed mskutin closed 8 years ago

mskutin commented 8 years ago

I'm about to make changes in Website AppSettings within deployment scenario. Noticed I don't have admin rights to change the registry. Added my variable to $ENV: but it's not available from portal and exist only in a current session.

davidebbo commented 8 years ago

You cannot affect the Azure App Settings during deployment. It's something that needs to be done using the Azure API, which you can't call from inside the sandbox.

The closest thing you can do is drop an XDT transform to add some environment variables. Sample here. They still won't show up in the Portal/API, but they will be effective at runtime.

mskutin commented 8 years ago

@davidebbo Please fix me if I wrong. There is no point to use https://github.com/projectkudu/kudu/wiki/REST-API#settings this, right? Can I modify Azure App Settings using Kudu REST API? When I make changes in /api/settings they are exists only on this page, but unavailable from portal, /Env and ARM, etc.

davidebbo commented 8 years ago

@mskutin You are correct; this API will not help. It is only used as an alternate way to set Kudu settings, but it does not have the same effect as general settings.