Skip to content

Source code for contributions to the Octopus Deploy Library

License

Notifications You must be signed in to change notification settings

teamtam/octopus-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build status

octopus-templates

Source code for contributions to the Octopus Deploy Library.

Set-AspNetCoreEnvVars.ps1

A PowerShell script to set an ASP.NET Core runtime environment variable in a web.config file.

The most likely use for this is to take advantage of the MVC Environment tag helpers now available in ASP.NET Core.

The benefit of setting an environment variable in web.config is that not only will the scope be restricted to the runtime of the app, but it will also take precedence over corresponding ones found in IIS, user environment variables or system environment variables. This means it is easier to independently configure apps deployed on the same machine.

In addition, web.config transforms are no longer an option in ASP.NET Core. If you use a token substitution method to manage environment variables in web.config, it will likely break your local configuration.

Parameters

  • anc_WebConfigPath: The path to the web.config file, typically derived from an output variable in a previous step
  • anc_EnvironmentVariableName: Name of environment variable to set
  • anc_EnvironmentVariableValue: Value of environment variable to set

About

Source code for contributions to the Octopus Deploy Library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published