tag:help.appveyor.com,2012-11-13:/discussions/questions/3129-pass-web-deploy-password-to-environment-deployment-as-a-variableAppVeyor: Discussion 2018-10-19T08:18:12Ztag:help.appveyor.com,2012-11-13:Comment/418847712017-02-03T18:35:04Z2017-02-03T18:35:04ZPass Web Deploy password to Environment deployment as a variable<div><p>Yes, sure you can do something like this:</p>
<pre>
<code>environment:
wappwd:
secure: wo3gqImLjckquy1VnmwSL/S6H1Q1m7t6iKUGcvhKrzDDTIsBB2Qd2rz6Nmz6d9i9nTT5B1ci017GElrkKdf0ow==
...
deploy:
- provider: WebDeploy
...
password: $(wappwd)</code>
</pre>
<p>However I am not sure if this is is what you want. Are you going
to provide different passwords depending on different conditions on
the fly? Can you please elaborate the scenario more?</p>
<p>Ilya.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/418847712017-02-05T15:55:51Z2017-02-05T15:55:51ZPass Web Deploy password to Environment deployment as a variable<div><p>We have several web applications running as Azure App Services.
Following the documentation <a href="https://www.appveyor.com/docs/deployment/environment">here</a>, I
would like to create a new <a href="https://ci.appveyor.com/environments/new">deployment
environment</a> (using the "Web Deploy" provider) that can be
shared across multiple projects for deploying to Azure. According
to the <a href="https://www.appveyor.com/docs/deployment/environment/#overriding-environment-variables">
documentation</a>, I can use environment variables in several of
the fields when creating a new environment (see attached
screenshot). The environment variables can than be set in our
projects <code>appveyor.yml</code> files like so:</p>
<pre>
<code>deploy:
- provider: Environment
name: Azure (Production)
website_name: webapp
website_username: $(app_username)
website_password: $(app_password)</code>
</pre>
<p>However, the "Password" field on the page to create a deployment
environment masks user input (as you can see in the attached
screenshot). Does this mean that that field cannot rely on an
environment variable in the same way that the Username field does?
If so, that would mean that I need to create an new Environment per
application, since Azure assigns unique Web Deploy credentials per
App Service.</p></div>jrusbatchtag:help.appveyor.com,2012-11-13:Comment/418847712017-02-06T02:44:57Z2017-02-06T02:44:57ZPass Web Deploy password to Environment deployment as a variable<div><p>I see, sorry missed that this is Environment deployment.</p>
<p>You can actually do that by copy-paste
<code>$(website_password)</code> into <code>Password</code> field.
This will work because internally all settings are treated the same
way and if setting value (after it is decrypted) looks like
variable (<code>$(something)</code>), AppVeyor will try to
substitute it with value of variable named
<code>something</code>.</p>
<p><strong>But you don't have to do it!!!</strong> You can use the
same user-level/deployment credentials for all of those sites
instead of publishing profile credentials. Please <a href="https://github.com/projectkudu/kudu/wiki/Deployment-credentials">this
doc</a> to get simple difference explanation. Sure this will work
great if your sites are under the same MS account. If not you can
theoretically reset those credentials to be the same between
accounts, though this is questionable from security
perspective.</p>
<p>Hope this helps.<br>
Ilya.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/418847712017-02-06T13:30:08Z2017-02-06T13:30:08ZPass Web Deploy password to Environment deployment as a variable<div><p>Awesome! I hadn't seen that page on the Kudu wiki, either!
Thanks for your help!</p></div>jrusbatch