Search code examples
amazon-web-servicesamazon-elastic-beanstalkawsdeploy

Visual Studio "Publish to AWS..." - when does Web.config updates for environment variables happen?


I'm attempting to replicate what Visual Studio does in its "Publish to AWS..." dialog via command line tools. I'm to the point where I'm calling "awsdeploy.exe" and passing it a configuration file. I've been playing with the sample that gets installed at

C:\Program Files (x86)\AWS Tools\Deployment Tool\Samples

whenever you install the AWS tools. I'm able to publish a dummy app to Elastic Beanstalk using this sample. However, one thing I'm trying to accomplish is the step that the wizard does where it asks you what Environment Variables you want, and then puts those in your Web.config <appSettings> if they aren't there already. How would I do this from the command line? I've attempted to put

aws:elasticbeanstalk:application:environment.SOME_VAR = some_value

in my configuration file, but I'm not seeing any value get added.


Solution

  • I believe I can answer my own question after further research. I found that if you do use the

    aws:elasticbeanstalk:application:environment.SOME_VAR = some_value
    

    syntax in the config file, that this does indeed set appSettings. It just does it at a different directory level. I found that the web.config file at C:\inetpub\wwwroot was updated to include my SOME_VAR setting, which was exactly what I was needing. My application itself is deployed at C:\inetpub\wwwroot\myapplication_deploy.