Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc dotnet core在Github操作中访问环境变量_Asp.net Mvc_Github_.net Core_Environment Variables_Github Actions - Fatal编程技术网

Asp.net mvc dotnet core在Github操作中访问环境变量

Asp.net mvc dotnet core在Github操作中访问环境变量,asp.net-mvc,github,.net-core,environment-variables,github-actions,Asp.net Mvc,Github,.net Core,Environment Variables,Github Actions,我在GitHub存储库中将Firebase URL设置为机密。现在我正试图在dotnet核心web应用程序和我拥有的CI/CD管道中访问它。我正在尝试使用下面的代码访问环境变量 Environment.GetEnvironmentVariable(fireBaseURLRoot,EnvironmentVariableTarget.Machine) 这仅在本地终端中运行应用程序时有效。但是我也尝试在GitHub操作运行期间使环境变量可用。因此,我的测试从终端获取环境变量。我做错了什么 谢谢 Dot

我在GitHub存储库中将Firebase URL设置为机密。现在我正试图在dotnet核心web应用程序和我拥有的CI/CD管道中访问它。我正在尝试使用下面的代码访问环境变量

Environment.GetEnvironmentVariable(fireBaseURLRoot,EnvironmentVariableTarget.Machine)

这仅在本地终端中运行应用程序时有效。但是我也尝试在GitHub操作运行期间使环境变量可用。因此,我的测试从终端获取环境变量。我做错了什么

谢谢

Dotnet核心应用程序

GitHub操作

您是否尝试将
FIREBASE\u URL
设置为env,就像
图像\u名称一样(也可以在步骤或作业级别完成)?此外,是否需要在dotnet文件中使用
$
来获取变量值?