title: Blazor: Managing Environment Specific Variables
body: <p>How can I manage access variables which differ among environments in client side blazor? Normally since I use Azure to publish applications, I'd use the <code>appsettings.json</code> file for local app settings and then set up entries in the Azure Application Settings section of my App Service for entries that differ between local environments and other environments. </p>
  
  <p>An example of what I'm looking to accomplish:</p>
  
  <p>Client side Blazor:</p>
  
  <pre><code>@functions {
      //...more code here
      await Http.PostJsonAsync&lt;object&gt;("http://localhost:50466/api/auth/register", vm);
  }
  </code></pre>
  
  <p>on the deployed web server this should be transformed to:</p>
  
  <pre><code>@functions {
      //...more code here
      await Http.PostJsonAsync&lt;object&gt;("http://wwww.mywebsite.com/api/auth/register", vm);
  }
  </code></pre>
  
  <p>So I'm looking for a way to store the site root url in an environment variable and transform it upon publish. Is there a Blazor-ey way to do this? </p>