Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/DotNetWorker.Grpc/Definition/GrpcFunctionDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public GrpcFunctionDefinition(FunctionLoadRequest loadRequest, IMethodInfoLocato
Name = loadRequest.Metadata.Name;
Id = loadRequest.FunctionId;

string? scriptRoot = Environment.GetEnvironmentVariable("AzureWebJobsScriptRoot");
string? scriptRoot = Environment.GetEnvironmentVariable("FUNCTIONS_WORKER_DIRECTORY");
if (string.IsNullOrWhiteSpace(scriptRoot))
{
throw new InvalidOperationException("The 'AzureWebJobsScriptRoot' environment variable value is not defined. This is a required environment variable that is automatically set by the Azure Functions runtime.");
throw new InvalidOperationException("The 'FUNCTIONS_WORKER_DIRECTORY' environment variable value is not defined. This is a required environment variable that is automatically set by the Azure Functions runtime.");
}

if (string.IsNullOrWhiteSpace(loadRequest.Metadata.ScriptFile))
Expand Down
1 change: 1 addition & 0 deletions src/DotNetWorker.Grpc/DotNetWorker.Grpc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<RootNamespace>Microsoft.Azure.Functions.Worker.Grpc</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<MinorProductVersion>8</MinorProductVersion>
<PatchProductVersion>1</PatchProductVersion>
<VersionSuffix>-preview1</VersionSuffix>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions src/DotNetWorker/DotNetWorker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<RootNamespace>Microsoft.Azure.Functions.Worker</RootNamespace>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<MinorProductVersion>12</MinorProductVersion>
<PatchProductVersion>1</PatchProductVersion>
<VersionSuffix>-preview1</VersionSuffix>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion test/DotNetWorkerTests/GrpcFunctionDefinitionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class GrpcFunctionDefinitionTests
[Fact]
public void Creates()
{
using var testVariables = new TestScopedEnvironmentVariable("AzureWebJobsScriptRoot", ".");
using var testVariables = new TestScopedEnvironmentVariable("FUNCTIONS_WORKER_DIRECTORY", ".");

var bindingInfoProvider = new DefaultOutputBindingsInfoProvider();
var methodInfoLocator = new DefaultMethodInfoLocator();
Expand Down
6 changes: 3 additions & 3 deletions test/DotNetWorkerTests/GrpcWorkerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public GrpcWorkerTests()
[Fact]
public void LoadFunction_ReturnsSuccess()
{
using var testVariables = new TestScopedEnvironmentVariable("AzureWebJobsScriptRoot", "test");
using var testVariables = new TestScopedEnvironmentVariable("FUNCTIONS_WORKER_DIRECTORY", "test");

FunctionLoadRequest request = CreateFunctionLoadRequest();

Expand All @@ -97,7 +97,7 @@ public void LoadFunction_WithProxyMetadata_ReturnsSuccess()
[Fact]
public void LoadFunction_Throws_ReturnsFailure()
{
using var testVariables = new TestScopedEnvironmentVariable("AzureWebJobsScriptRoot", "test");
using var testVariables = new TestScopedEnvironmentVariable("FUNCTIONS_WORKER_DIRECTORY", "test");

_mockApplication
.Setup(m => m.LoadFunction(It.IsAny<FunctionDefinition>()))
Expand All @@ -115,7 +115,7 @@ public void LoadFunction_Throws_ReturnsFailure()
[Fact]
public void MethodInfoLocator_Throws_ReturnsFailure()
{
using var testVariables = new TestScopedEnvironmentVariable("AzureWebJobsScriptRoot", "test");
using var testVariables = new TestScopedEnvironmentVariable("FUNCTIONS_WORKER_DIRECTORY", "test");

_mockMethodInfoLocator
.Setup(m => m.GetMethod(It.IsAny<string>(), It.IsAny<string>()))
Expand Down