tag:help.appveyor.com,2012-11-13:/discussions/questions/16687-use-encrypted-tokensAppVeyor: Discussion 2019-01-18T00:25:09Ztag:help.appveyor.com,2012-11-13:Comment/445049132018-01-14T10:05:41Z2019-01-18T00:25:09ZUse encrypted tokens<div><p>I encrypt a token (a SonarCloud token) using AppVeyor encryption tool (<a href="https://ci.appveyor.com/tools/encrypt">https://ci.appveyor.com/tools/encrypt</a>), and declare it as the following:</p>
<p>environment:<br>
sonartoken: secure: zx9FQl2yXcPb8X7A4BqN753h1TFSuHioq13TFRwQk04/1cSxEFaqR1j+UAuJhyT7</p>
<p>Then I use it as the following (in the same appveyor.yml file):</p>
<ul>
<li>MSBuild.SonarQube.Runner.exe end /d:"sonar.login=%sonartoken%"</li>
</ul>
<p>But then Sonar complains the token being invalid.</p>
<p>I have tried the followings too:</p>
<ul>
<li>MSBuild.SonarQube.Runner.exe end /d:"sonar.login=$env:sonartoken"</li>
<li>ps: MSBuild.SonarQube.Runner.exe end /d:"sonar.login=$env:sonartoken"</li>
</ul></div>jalili.vahidtag:help.appveyor.com,2012-11-13:Comment/445049132018-01-14T14:49:08Z2018-01-14T14:49:08ZUse encrypted tokens<div><p>Vahid,</p>
<p>You are trying using secure variables in pull request. However secure variables are not available in Pull Requests. For open source projects you can use "Enable secure variables in Pull Requests from the same repository only" option available in the UI, in project General Settings.</p>
<p>Ilya.</p></div>Ilya Finkelshteyn