0

I follow the documentation to setup an app function with runtime version V3 but it throws InternalServerError. How can I create an app function to work with V3? These are my steps:

  1. I create a fresh app service azure function app (in portal).
  2. When the resource is ready and without making any changes or enter any code in portal or deploy any code from VS, I go to Function App Settings and shows "~3" selected, Runtime version: Runtime version: loading... (it's stuck there) and error mssg in a box on the right hand side of the screen:

Error: Encountered an error (InternalServerError) from host runtime

I tried to select runtime version ~2 in Function Application settings, but the Runtime Version shows "loading..." and if I exit and go back to this function, it shows ~2 as selected but the InternalServerError continues to show and Runtime version shows "loading..."

If I change to version ~1 it works showing runtime version 1.012967.0. But I can't change back to V3 because it shows internalServerError again.

According to documentation "function apps are created in version 2.x of the runtime" but when I first created the function it seems to create it in V1?. Kudu showed at home/LogFiles/eventlog.xml "Provider Name="IIS AspNetCore Module V2"/"

I later tried to deploy my VS code into this function app with V3 functions in VS and portal but of course this would not work. And deploying V3 from VS with V1 in portal is not the suggested process by the documentation "Although the runtime version is determined by the FUNCTIONS_EXTENSION_VERSION setting, you should make this change in the Azure portal and not by changing the setting directly. "

Finally, if I try to create the app function from VS, it automatically creates it with V2 and when checking in the portal I get the same internalservererror. It only works with V1 1.0.12967.0 (~1).

Help really appreciated

Sergio Solorzano
  • 476
  • 9
  • 29
  • 1
    Is the app setting `AzureWebJobsStorage` present on the function app? If it is missing, it can cause such errors. – Alex AIT Mar 07 '20 at 12:52
  • 1
    Glad you were able to solve your issue. I'll write up a quick answer so it can be resolved. You can also write up your own answer if you prefer. – Alex AIT Mar 07 '20 at 15:19
  • sorry @AlexAIT I've deleted my comments because when I went back it seems to crap out again, i'll triple check and post back. apologies! – Sergio Solorzano Mar 07 '20 at 15:27
  • Checked-repost: thanks @AlexAIT AIT yes I had it. Your comment reminded me I was meeting the storage requirement ("You need a general purpose account that supports blobs, tables, queues, and files") but had set it up to Azure's recommend GPV2. However, and this is not mentioned in "Automate resource deployment for your function app in Azure Functions", in documentation "App settings reference for Azure Functions" says "The storage account must be a general-purpose one that supports blobs, queues, and tables"! Created a new function letting the storage(GPV1)be selected by the portal and works:) – Sergio Solorzano Mar 07 '20 at 15:48
  • What I find confusing though is in this same article "App settings reference for Azure Functions" two related statements are made: "AzureWebJobsStorage: The Azure Functions runtime uses this storage account connection string for all functions except for HTTP triggered functions. The storage account must be a general-purpose one that supports blobs, queues, and tables." But mine is an HTTP trigger so in theory GPV2 should be fine...in fact that's how I think I had it setup a couple of days ago when it worked... – Sergio Solorzano Mar 07 '20 at 15:48

2 Answers2

5

Errors such as this can occur if AzureWebJobsStorage app setting is missing or invalid.

The reason for your problems is probably an issue with the selected Storage Account, since switching to a new one helps. Maybe there is a lock or something which blocked the account.

Azure Functions V3 are compatible with General Purpose V2 Storage Accounts - I just checked and we have a couple of them up and running.

Alex AIT
  • 17,361
  • 3
  • 36
  • 73
  • 1
    as per comments above, I retried with GPV1 and worked but 5 min later gave error again. I think because I updated the app function's Platform 64bit, http2,ftp disabled, always on at once? So I deleted the function again, remade with GPV1 and worked fine. Made the changes 1 by one after saving for each. Then upgraded to GPV2 and also works...can't tell, but the problem has been occurring since yesterday afteroon (~24 hours). Thanks @Alex AIT ! – Sergio Solorzano Mar 07 '20 at 15:52
0

In my case it was the WEBSITE_RUN_FROM_PACKAGE app setting that was empty due to some misconfigured Terraform. In my scenario its value should have been 1.

wolfyuk
  • 746
  • 1
  • 8
  • 26