title: AzureWebJobsScriptRoot variable is not defined on Azure Functions, but returns correct value locally
body: <p>AzureWebJobsScriptRoot variable is not defined on Azure Functions. The code below returns no value.
  <code> System.Environment.GetEnvironmentVariables(EnvironmentVariableTarget.Process)[&quot;AzureWebJobsScriptRoot&quot;];</code></p>
  <p>However,<code> %HOME%\site\wwwroot</code> will be returned based on below:</p>
  <p><a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#azurewebjobsscriptroo" rel="nofollow noreferrer">AzureWebJobsScriptRoot</a></p>
  <blockquote>
  <p>AzureWebJobsScriptRoot</p>
  <p>The path to the root directory where the host.json file and function folders are located. In a function app, the default is %HOME%\site\wwwroot.</p>
  <p>Key            Sample value</p>
  <p>AzureWebJobsScriptRoot    %HOME%\site\wwwroot</p>
  </blockquote>
  <p>It returns correct value locally, not %HOME%\site\wwwroot</p>
  <p><strong>Update</strong></p>
  <p>Is this a bug with Azure Functions?</p>
  <p>If so, what is an alternative solution?</p>
  <p>Before the issue is fixed by Microsoft, can this variable, <code>AzureWebJobsScriptRoot</code>, be defined myself to <code>&quot;%HOME%\site\wwwroot&quot;</code> on Azure?</p>
  <p><a href="https://github.com/Azure/Azure-Functions/issues/1146" rel="nofollow noreferrer">https://github.com/Azure/Azure-Functions/issues/1146</a>
  <a href="https://github.com/MicrosoftDocs/azure-docs/issues/26761" rel="nofollow noreferrer">https://github.com/MicrosoftDocs/azure-docs/issues/26761</a></p>