Azure Function DI Failure Unable to resolve service for type 'Microsoft.Azure.WebJobs.Script.IEnvironment'

Brett McDonald 1 Reputation point
2020-12-31T19:02:36.633+00:00

Unable to resolve service for type 'Microsoft.Azure.WebJobs.Script.IEnvironment'

Here is the debug console log. I am trying to figure out where IEnvironment is missing or called? Not in my code.

[2020-12-31T18:50:35.399Z] Executing HTTP request: {
[2020-12-31T18:50:35.400Z] requestId: "f4384b7e-d26b-4980-bcb0-f3ba5a4d77fe",
[2020-12-31T18:50:35.400Z] method: "POST",
[2020-12-31T18:50:35.401Z] userAgent: "PostmanRuntime/7.26.8",
[2020-12-31T18:50:35.402Z] uri: "/api/Verify"
[2020-12-31T18:50:35.403Z] }
[2020-12-31T18:50:35.405Z] Request successfully matched the route with name 'Verify' and template 'api/Verify'
[2020-12-31T18:50:35.493Z] Executed 'Verify' (Failed, Id=279bf31b-569d-4611-ae4d-042988e79bd5, Duration=84ms)
[2020-12-31T18:50:35.495Z] Microsoft.Extensions.DependencyInjection: Unable to resolve service for type 'Microsoft.Azure.WebJobs.Script.IEnvironment' while attempting to activate 'Microsoft.Azure.WebJobs.Script.Configuration.ScriptHostOptionsSetup'.
[2020-12-31T18:50:35.716Z] An unhandled host error has occurred.
[2020-12-31T18:50:35.717Z] Microsoft.Extensions.DependencyInjection: Unable to resolve service for type 'Microsoft.Azure.WebJobs.Script.IEnvironment' while attempting to activate 'Microsoft.Azure.WebJobs.Script.Configuration.ScriptHostOptionsSetup'.
[2020-12-31T18:50:35.718Z] Executed HTTP request: {
[2020-12-31T18:50:35.719Z] requestId: "f4384b7e-d26b-4980-bcb0-f3ba5a4d77fe",
[2020-12-31T18:50:35.720Z] identities: "",
[2020-12-31T18:50:35.720Z] status: "500",
[2020-12-31T18:50:35.721Z] duration: "319"
[2020-12-31T18:50:35.722Z] }

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,605 questions
{count} votes