Azure Functions上未定义AzureWebJobsScriptRoot变量 [英] AzureWebJobsScriptRoot variable is not defined on Azure Functions

查看:66
本文介绍了Azure Functions上未定义AzureWebJobsScriptRoot变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Azure功能上未定义AzureWebJobsScriptRoot变量。下面的代码没有返回值。

AzureWebJobsScriptRoot variable is not defined on Azure Functions. The code below returns no value.

`System.Environment.GetEnvironmentVariables(EnvironmentVariableTarget.Process [" AzureWebJobsScriptRoot"];`



但是,`%HOME%\ site\wwwroot`将根据以下内容返回:



https://docs.microsoft.com/en- us / azure / azure-functions / functions-app-settings#azurewebjobsscriptroo

`System.Environment.GetEnvironmentVariables(EnvironmentVariableTarget.Process["AzureWebJobsScriptRoot"];`

However,` %HOME%\site\wwwroot` will be returned based on below:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings#azurewebjobsscriptroo

"

AzureWebJobsScriptRoot



  host.json文件和函数文件夹所在的根目录的路径。在功能应用程序中,默认为%HOME%\\ \\ site \ www.root。
$


  Key           示例值



  AzureWebJobsScriptRoot   %HOME%\ site \ www.root

&quo t;
$


它在本地返回正确的值,而不是%HOME%\site\wwwroot



更新



这是Azure功能的错误吗?



如果有的话什么是替代解决方案?
$


在微软修正问题之前,这个变量"AzureWebJobsScriptRoot"可以自己定义为``%HOME%\\ Azure上的\\ site\wwwroot"`$


https://github.com/Azure/Azure-Functions/issues/1146



AzureWebJobsScriptRoot

  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.

  Key              Sample value

  AzureWebJobsScriptRoot     %HOME%\site\wwwroot
"

It returns correct value locally, not %HOME%\site\wwwroot

Update

Is this a bug with Azure Functions?

If so, what is an alternative solution?

Before the issue is fixed by Microsoft, can this variable, `AzureWebJobsScriptRoot`, be defined myself to `"%HOME%\site\wwwroot"` on Azure?

https://github.com/Azure/Azure-Functions/issues/1146

推荐答案

感谢您与我们联系。将在内部检查并更新此线程。
Thanks for reaching out to us. Will check on this internally and update this thread.


这篇关于Azure Functions上未定义AzureWebJobsScriptRoot变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆