A host error has occurred during startup operation of App Fuctions inside Kubernetes

2/22/2021

I have deployed an Azure App Function project to AKS and have set all of the correct start variables required to run the app functions. It is continually failing during start up with the below error.

MessageException has been thrown by the target of an invocation. Value cannot be null. (Parameter 'hostingEnvironment')
Exception typeSystem.ArgumentNullException
Failed methodDryIoc.ReflectionFactory+<>cDisplayClass21_0.b1
Inner exception System.ArgumentNullException handled at System.RuntimeMethodHandle.InvokeMethod:
   at Microsoft.Extensions.Hosting.HostingEnvironmentExtensions.IsDevelopment (Microsoft.Extensions.Hosting.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Extensions.Hosting.StorageWebJobsBuilderExtensions+<>c.<AddAzureStorage>b__0_5 (Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.10.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.10.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35: C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\StorageWebJobsBuilderExtensions.csMicrosoft.Azure.WebJobs.Extensions.Storage, Version=3.0.10.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35: 74)
   at Microsoft.Extensions.Options.ConfigureNamedOptions`2.Configure (Microsoft.Extensions.Options, Version=3.1.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Extensions.Options.OptionsFactory`1.Create (Microsoft.Extensions.Options, Version=3.1.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Azure.WebJobs.Hosting.WebJobsOptionsFactory`1.Create (Microsoft.Azure.WebJobs.Host, Version=3.0.26.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35Microsoft.Azure.WebJobs.Host, Version=3.0.26.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35: C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Hosting\OptionsFormatter\WebJobsOptionsFactory.csMicrosoft.Azure.WebJobs.Host, Version=3.0.26.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35: 37)
   at Microsoft.Extensions.Options.OptionsManager`1+<>c__DisplayClass5_0.<Get>b__0 (Microsoft.Extensions.Options, Version=3.1.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at System.Lazy`1.ViaFactory (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Lazy`1.ExecutionAndPublication (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Lazy`1.CreateValue (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at System.Lazy`1.get_Value (System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e)
   at Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd (Microsoft.Extensions.Options, Version=3.1.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Extensions.Options.OptionsManager`1.Get (Microsoft.Extensions.Options, Version=3.1.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Extensions.Options.OptionsManager`1.get_Value (Microsoft.Extensions.Options, Version=3.1.10.0, Culture=neutral, PublicKeyToken=adb9793829ddae60)
   at Microsoft.Azure.WebJobs.Host.Queues.Triggers.QueueTriggerAttributeBindingProvider..ctor (Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.10.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.10.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35: C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.Storage\Queues\Triggers\QueueTriggerAttributeBindingProvider.csMicrosoft.Azure.WebJobs.Extensions.Storage, Version=3.0.10.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35: 42) 
-- adammmmmm
azure-functions
azure-servicebus-queues
c#
kubernetes
kubernetes-pod

0 Answers