Azure-functions-host: Javascript functions app wont deploy or run in azure

Created on 9 Oct 2018  路  8Comments  路  Source: Azure/azure-functions-host

Since V2 went GA we have been unable to successfully deploy or use the functions app that is part of our solution

@mhoeger mentioned as requested :)

Investigative information

Please provide the following:

  • Timestamp: 2018-10-09T10:00:44.669Z
  • Function App version (1.0 or 2.0): 2.0
  • Function App name: devfuncmtc
  • Function name(s) (as appropriate): all of them
  • Invocation ID: unable to get one, as the function errors on opening in the portal (details below)
  • Region: west europe
  • App Service runtime: Linux

Summary of the key problems....

  1. No official documentation on how to deploy node JS functions to azure
  2. The deployment i created now times out, every time.
  3. when navigating to any of the individual functions within the portal an error is shown in a red box.

Repro steps

Problem 2
  1. Create a VSTS deployment from this YAML file,
  2. Queue a build, observe eventual timeout when deploying zip file to Function App Service.
Problem 3
  1. open devfuncmtc in azure portal
  2. navigate to one of the functions
  3. observe error...
Function (check-started) Error: The binding type(s) 'queueTrigger, table' are not registered. 
Please ensure the type is correct and the binding extension is installed.
  1. Please note - these bindings are being installed with func extentions install during build & deploy

Expected behavior

  • Javascript function deployment is officially documented
  • Javascript function deployment does not time out
  • Javascript functions do not show an error in the portal

Known workarounds

None

Related information

Most helpful comment

@GuyHarwood I just noticed that you are using a Linux App Service, which is still in pre-release (unlike Functions on Windows, which is GA). Unfortunately, the Linux offering has a couple issues which combine here:

  • It struggles with deployments that have a large number of files, as is probably the case with your Node app
  • It does not yet support Run From Package, which on Windows is the way to keep the dpeloyment and runtime tight and fast (by not having to expand the zip at deploy time)

My suggestion would be to switch to using Windows, either with an App Service Plan (as you're using today), or in Consumption mode.

All 8 comments

Thanks @GuyHarwood for all the details!! So nice to have your code to see too :,)

That is very strange... Could you navigate to the Kudu site for your function app (http://devfuncmtc.scm.azurewebsites.net/) and check DebugConsole > site > wwwroot to see if the built bin and obj folders are there as expected? Can you also tell us your deployment method? Adding @davidebbo to correct me if I'm wrong, but I would suggest using Run From Zip (recently renamed Run From Package).

@mhoeger the bin and obj folders are there.

bin...

Microsoft.Build.Framework.dll
Microsoft.Build.Utilities.Core.dll
System.AppContext.dll
System.Collections.Concurrent.dll
System.Collections.NonGeneric.dll
System.IO.FileSystem.Primitives.dll
System.Linq.dll
System.ObjectModel.dll
System.Private.DataContractSerialization.dll
System.Reflection.Emit.ILGeneration.dll
System.Reflection.Emit.Lightweight.dll
System.Reflection.Emit.dll
System.Reflection.TypeExtensions.dll
System.Resources.Reader.dll
System.Runtime.Loader.dll
System.Runtime.Serialization.Primitives.dll
System.Runtime.Serialization.Xml.dll
System.Text.RegularExpressions.dll
System.Threading.Tasks.Extensions.dll
System.Threading.Thread.dll
System.Threading.ThreadPool.dll
System.Threading.dll
System.Xml.ReaderWriter.dll
System.Xml.XmlDocument.dll
System.Xml.XmlSerializer.dll
extensions.deps.json
extensions.dll
extensions.json
extensions.pdb

obj....

extensions.csproj.nuget.cache
extensions.csproj.nuget.g.props
extensions.csproj.nuget.g.targets
project.assets.json

My understanding was that Run From Zip isnt supported on linux yet?

some background on our deployment method...
we were using func pack to create a minified version of the node_modules dependencies, and then deleting node_modules before creating the deployment zip.
This worked, and the deploy step did not fail.

Since func pack became obsolete, and started throwing errors, we removed the steps above, and introduced the func extensions install step. Now the deployment times out, every time.

We use the Azure App Service Deploy task to deploy the functions zip file to the app service. is this correct? obviously without any formal documentation we are just guessing what the 'right way' is.

Reading through this issue, I feel it's trying to track too many unrelated things, as it's both covering deployment issues and runtime issues. If you are unable to deploy successfully, then you shouldn't get to the point where you can even try to run a function. If that's the case, then anything not related to deployment should be left out of the discussion.

Note that it is fine to open additional issues if you'd like to track separate things, but it is best to limit one issue to something very specific.

furthermore, i am trying to give a complete picture of the problem. If you read through my comments you will see that we did have a working deployment, which started to fail when func pack broke, so we have a deployed instance, but have been unable to complete subsequent deployments since func pack was retired.

@GuyHarwood I just noticed that you are using a Linux App Service, which is still in pre-release (unlike Functions on Windows, which is GA). Unfortunately, the Linux offering has a couple issues which combine here:

  • It struggles with deployments that have a large number of files, as is probably the case with your Node app
  • It does not yet support Run From Package, which on Windows is the way to keep the dpeloyment and runtime tight and fast (by not having to expand the zip at deploy time)

My suggestion would be to switch to using Windows, either with an App Service Plan (as you're using today), or in Consumption mode.

OK. good to know about the deployment issue.
I will explore using a windows app service and raise new issue(s) if necessary

Was this page helpful?
0 / 5 - 0 ratings