GithubHelp home page GithubHelp logo

Comments (17)

snobu avatar snobu commented on August 25, 2024 4

Resurrecting this issue. For those developing straight into the Portal editor a npm install button is really all that's needed right now. If you develop locally you most probably do it with source control, so Kudu takes care of npm install as deployment step. The Portal is what's making the whole npm install thing jarring, and it doesn't have to be. I believe a simple "actions" dropdown will make a huge difference:

  • npm init -y
  • npm install
  • npm install --save {MODULE_NAME_FROM_USER_INPUT}

Not sure how we can get a progress indicator for those actions since a npm install in Kudu isn't very verbose.

I agree the installation of dependencies should be uniform across supported languages, but for the time being, Node is really the one suffering the most from the Portal authoring experience.

update:
or we could simply bring the Kudu console over and open it in an overlay or soft tab.

from azure-functions-host.

alexshyba avatar alexshyba commented on August 25, 2024 4

+++ for adding a first class npm install for enhanced CD experience. npm is getting faster, so it should not be as big of an issue anymore. Running npm install manually is a bit of a pain...
Another suggestion: allow for using either yarn instead of npm (depending on the presence of yarn.lock.

from azure-functions-host.

atrauzzi avatar atrauzzi commented on August 25, 2024 2

An "npm install" button might be nice somewhere in here...

image

from azure-functions-host.

alterx avatar alterx commented on August 25, 2024 2

For the time being I think the best option is to keep a package.json file in the root folder and install every package from there. Those packages are available for every function.

For my use case this works.

from azure-functions-host.

mm-gmbd avatar mm-gmbd commented on August 25, 2024 2

+1 for this. I am standing up some Azure functions and doing this all through the Azure portal rather than through cli tools, so having this in the portal would be fantastic.

Any updates on progress? I.e. is this just in discussion phase? planned for development (i.e. in roadmap)? in development? in testing? I'm guessing it's the discussion phase based on the "needs-discussion" label, but just thought I'd ask in case the ticket is not totally up-to-date 😉

from azure-functions-host.

nikos avatar nikos commented on August 25, 2024 1

On a slightly related note: it would be great if after a "git push" (which deploys the new function version on the host) a "npm install" would automatically triggered. It seems currently after each deployment you have to visit the Console and install the node modules for each function over and over again.

from azure-functions-host.

dstrimble avatar dstrimble commented on August 25, 2024 1

At the very least it would make sense to run NPM install on function restart. I understand not doing it on every commit.

from azure-functions-host.

davidebbo avatar davidebbo commented on August 25, 2024

Key question is whether this should be a runtime or design time thing. Typically, in Kudu, it's always deployment time. but here for C# it sounds like it's runtime. Worth discussing.

from azure-functions-host.

mathewc avatar mathewc commented on August 25, 2024

Yeah, whatever we do should be consistent across the languages.

from azure-functions-host.

davidebbo avatar davidebbo commented on August 25, 2024

Tricky thing about npm is that it's super slow to run even when there is no work to do. So we probably can't run install before running the function just in case the packages changed. Or maybe we'd need a smart marker that tells us when packages.json changed since the last npm run.

from azure-functions-host.

danderson00 avatar danderson00 commented on August 25, 2024

A workaround for the moment is to execute npm install from a kudu console. However, it will likely fail if the package contains binaries as the version in the path in kudu will likely be different from the version running the function.

from azure-functions-host.

christopheranderson avatar christopheranderson commented on August 25, 2024

We should discuss this. It's an interesting question. C# has the project.json per function. Node can do per function or per function app. We know that package management UI is expensive and probably out of scope. I'm inclined to say this is post RC, but I'd like to think about exposing the kudu terminal in an easier way to help mitigate (/cc @mattchenderson)

from azure-functions-host.

christopheranderson avatar christopheranderson commented on August 25, 2024

If you have a package.json at the root of your Function App, it will do so today. If we support a per function package.json later on, we'll have to see what we do. We might rely on the host to manage that, if we do.

from azure-functions-host.

nikos avatar nikos commented on August 25, 2024

At least for my current environment (using Function App version Latest (~0.4)) it does not work, but I had to manually trigger npm install after every git push again manually, as described in https://azure.microsoft.com/en-us/documentation/articles/functions-reference-node/ under Node Version & Package Management. This makes my DX not as pleasant as it probably could be.

from azure-functions-host.

alterx avatar alterx commented on August 25, 2024

Yeah, I was wondering if there was a way of remotely triggering npm install for each function
It doesn't make much sense to have to manually log into the kudu console to run it. For node, this should be something that you can either start remotely or that runs automagically if it finds a valid package.json file after deploying.

from azure-functions-host.

atrauzzi avatar atrauzzi commented on August 25, 2024

The thing that's most important to me is that it happens quickly enough to be useful. Right now, even though we have the option to do it from the kudu console, the speed makes it a non-option.

from azure-functions-host.

fabiocav avatar fabiocav commented on August 25, 2024

This is not something we're currently tracking or planning to execute on. Closing to reflect that.

from azure-functions-host.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.