tag:help.appveyor.com,2012-11-13:/discussions/questions/56139-webdeploy-w-aspnetcore_environment
AppVeyor: Discussion
2022-01-18T21:02:48Z
tag:help.appveyor.com,2012-11-13:Comment/49495639
2021-11-17T19:04:08Z
2021-11-17T19:04:10Z
WebDeploy w/ ASPNETCORE_ENVIRONMENT
<div><p>Hi,</p>
<p>I am trying to figure out how to set ASPNETCORE_ENVIRONMENT for Webdeploy to create web.config that reflects it.<br>
Currently it will deploy without the environmentVariables element.</p>
<p>I tried to set the:<br>
environment:<br>
ASPNETCORE_ENVIRONMENT: Staging</p>
<p>However it does not seem to pick it up during deploy. Am I missing something?<br></p>
<pre>
<code>environment:
ASPNETCORE_ENVIRONMENT: Staging
deploy:
- provider: WebDeploy
server: url
website: sitename
username: username
password:
secure: password
artifact: artifact
app_offline: true
skip_dirs: '\\App_Data'
skip_files: license.json
remove_files: true
on:
branch: develop</code>
</pre>
<p>What I get<br></p>
<pre>
<code><?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="<em>" verb="</em>" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\args" stdoutLogEnabled="false" hostingModel="InProcess" stdoutLogFile=".\logs\stdout"/>
</system.webServer>
</location>
</configuration></code>
</pre>
What I want:<br>
<pre>
<code><?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="<em>" verb="</em>" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\args" stdoutLogEnabled="false" hostingModel="InProcess" stdoutLogFile=".\logs\stdout">
<environmentVariables>
<environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Staging" />
</environmentVariables>
</aspNetCore>
</system.webServer>
</location>
</configuration></code>
</pre></div>
Artur O
tag:help.appveyor.com,2012-11-13:Comment/49495639
2021-11-18T03:04:25Z
2021-11-18T03:04:25Z
WebDeploy w/ ASPNETCORE_ENVIRONMENT
<div><p>You should implement Web Deploy parametrization: <a href="https://www.appveyor.com/docs/deployment/web-deploy/#web-deploy-parametrization">https://www.appveyor.com/docs/deployment/web-deploy/#web-deploy-par...</a></p></div>
Feodor Fitsner