Can I specify the registry before installing the dependent packages in Azure Function (javascript)?

Yong Ding (丁勇) 21 Reputation points
2021-10-20T13:46:45.39+00:00

I chose the Local Git deployment method using Azure Fcuntion. My programming language is javascript. When I upload the code from local machine to Azure Functions by using Git, the 'node_moudle' directory is not uploaded, so I have a few questions to know:

  1. Will 'npm install' be executed after uploading the code?
  2. During the execution of 'npm install', which registry is the dependency package pulled from?
  3. How to specify the registry in this process?

Thanks.

Refrence doc: https://learn.microsoft.com/en-us/azure/azure-functions/functions-deployment-technologies

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,263 questions
0 comments No comments
{count} votes

Accepted answer
  1. MughundhanRaveendran-MSFT 12,421 Reputation points
    2021-10-22T11:51:54.84+00:00

    Hi @Yong Ding (丁勇) ,

    Thanks for reaching out to this forum.

    When deploying Function Apps from source control, any package.json file present in your repo, will trigger an npm install in its folder during deployment. But when deploying via the Portal or CLI, you will have to manually install the packages.

    Please look into this article which has the ways to install packages in Function app

    I hope this answers your question (1).

    During the npm install, the dependency package would be pulled from npm public registry. If you are looking use your own modules, this article seems to have the details.

    I hope this answers your other queries as well. Feel free to reach out to me if you have any queries.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful