How to install aditional components in Azure Web Apps and make it persist

Nelson Mendaros 61 Reputation points
2022-06-13T07:39:39.033+00:00

I created an PHP Azure Web App code deploy environment with laravel project and need to install additional components such as npm and nodejs but I run into several problems such as persistency, environment upgrade and permission issues.

Is there a way to install npm and other components and also upgrade it on PHP Azure Web App with Laravel project?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,939 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Andriy Bilous 11,821 Reputation points MVP Volunteer Moderator
    2022-06-13T08:36:32.167+00:00

    Hello @Nelson Mendaros

    I suggest you to create your custom Linux docker image based on PHP and install node as there is no official docker image that has both PHP and node in it.
    I would not recommend to use 3rd party unofficial docker images as they may have security vulnerabilities.

    210719-image.png

    Dockerfile example with PHP:

    FROM mcr.microsoft.com/appsvc/php:7.4-apache_20201229.1  
          
    RUN apt-get update -yq \  
         && apt-get install curl gnupg -yq \  
         && curl -sL https://deb.nodesource.com/setup_16.x | bash \  
         && apt-get install nodejs -yq  
    

    https://heyko.medium.com/customized-container-images-for-azure-appservice-b8e2fc5f80d9

    If you think your question has been answered, click "Mark as Answer" if just helped click "Vote as helpful". This can be beneficial to other community members reading this forum thread.

    0 comments No comments

  2. Nelson Mendaros 61 Reputation points
    2022-06-13T12:55:02.923+00:00

    Update: My issue on installing additional Linux component is now resolved. The reason I need to install those components is to build some parts of the application. I move the installation and build tasks on CI. Thank you for the help!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.