Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

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

Releases

No releases published

Packages

No packages published