0

When I try to upload the zip file to an azure function app using kudu REST API, it throws an error while I try to view the c# code in Function App editor in the browser. The error is: "Error:

Function ($Source) Error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.Source'. Microsoft.Azure.WebJobs.Host: Value cannot be null. Parameter name: hostAccount. Session Id: xxxxxxxxxxx

Timestamp: 2016-12-02T18:35:00.083Z"

Please note that I have automated end to end of Application Insights starting from creation of a resource group till exporting the multi-setep web test results to our Splunk - All using Powershell.

In this process of automation, I am forming a storage connection string and setting it to the app settings of the function app and then providing that key in my function.json binding.

But still I get this error.

Here is the issue I created in the Azure Function App - Git: https://github.com/Azure/azure-webjobs-sdk-script/issues/1020

Loganathanpc
  • 45
  • 1
  • 9

1 Answers1

1

The error points to missing host configuration (e.g. the host storage account).

If you're automating the creation process, you need to make sure the required environment variables are properly set. The recommended way would be to use an ARM template manage that for you.

I have some details on how you can get the ARM template for a resource (which you could use to look at the required settings for your Function App) here.

We also have some sample templates you can use linked here

I hope this helps!

Community
  • 1
  • 1
Fabio Cavalcante
  • 12,328
  • 3
  • 35
  • 43
  • The storage account and container is created in my previous step before creating the function app. And I am able to access the container successfully with Cloud Explorer. Here the actual error is not about creating a function app. Because the error says "hostAccount", which is the host storage account. Imagine this situation where I create a function app which needs a HTTP trigger. Does it still need a storage account? – Loganathanpc Dec 02 '16 at 20:11
  • 1
    That's the storage account used by the function. You can use the same same storage account, but the host environment variable must be set, pointing to that account. – Fabio Cavalcante Dec 02 '16 at 20:13
  • Gotcha! I will see how the host account can be referred! I also see that when we manually create a Function App, a storage account is mandatory. Thanks a lot @Fabio! I will continue my research and will let you know the results. – Loganathanpc Dec 02 '16 at 20:18