title: How can I use set Environment Variables in Xamarin.Forms from App Center
body: <p>I have a Xamarin Forms app which is being built using App Center. The app contains some code that looks like:</p>
  
  <pre><code>var secret= "secretvaluegoeshere";
  </code></pre>
  
  <p>I then use the secret to communicate with an API. Now I want to extract that secret from code so as not to having it in source control and inject it when building on App Center. <a href="https://docs.microsoft.com/en-us/appcenter/build/custom/variables/" rel="noreferrer">Environment Variables</a> seem like they should solve this very problem but the examples in the docs don't mention how they can get into code (only nuget and gradle config). Is there a way to do what I want with Environment Variables or should I be doing this another way?</p>