André Carlucci

Skeptic .net development

Setting environment variables for asp.net core when publishing on IIS

Environment variables can be set directly on IIS Manager following these steps:

  1. Open the IIS Manager and select your website
  2. Open “Configuration Editor” from “Management” section
  3. On the first dropdown (section), select “system.webServer/aspNetCore”
  4. On the second (from), select web.config
  5. Then select “environmentVariables”, click on the “…” and use the add/remove buttons to configure as you want.
  • Simon Weaver

    But they get reset when you redeploy!

    • niico100

      They are stored in web.config – if you redeploy web.config they’ll be removed.