我已经在我的AWS Lambda中定义了几个环境变量,但是当我尝试在我的.Net代码中访问它们时,它们是空白的。我错过了什么?
源代码:
public void CalculateInterimReviewsToBeCreated(Input input, ILambdaContext context)
{
var uri = new Uri(getFSRHistoryURL);
using (var httpClient = new HttpClient { BaseAddress = uri })
{
var authenticationHeaderKey = System.Environment.GetEnvironmentVariable("AuthenticationHeaderKey");
LambdaLogger.Log("CalculateInterimReviewsToBeCreated : authenticationHeaderKey" + authenticationHeaderKey);
...
}
...
}
CloudWatch显示空白环境变量: had the same issue a couple of years ago and it was posted on the Apple forums
答案 0 :(得分:3)
您已在标记部分中指定了环境变量,因此出现了问题。您必须在“环境变量”部分中指定变量。