Linux Wordpress App Service - Run Startup command on app service instead of Kudu

spurro 60 Reputation points
2025-06-02T13:48:47.1366667+00:00

Stack: Wordpress

container image: mcr.microsoft.com/appsvc/wordpress-debian-php:8.3

Is it possible to run the app service Startup command on the actual app service, rather than Kudu?

I have a script which is reliant on dependencies that exist on the app service, but not in the Kudu container. When the startup command runs as a post-deployment action, it runs on Kudu, which causes an error because the dependency doesn't exist. Also, running apt-get seems to not be an option, as its not possible to execute sudo in the Kudu service. (Attempting to run apt-get install results in "Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?")

If I could run the startup script on the app service, the apt-get step would not even be needed.

Unless there is a way to run apt-get on Kudu as root, which based on my research so far seems not to be possible

Thanks,

Steve

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

Accepted answer
  1. Shree Hima Bindu Maganti 4,775 Reputation points Microsoft External Staff Moderator
    2025-06-02T15:46:53.76+00:00

    Hi @spurro
    Running a startup command directly on the App Service instead of Kudu is not supported. Startup commands are executed in the Kudu environment, which is separate from the App Service runtime. Therefore, any dependencies or commands relying on the App Service's environment will not work in Kudu.

    Unfortunately, Kudu does not allow running commands with root privileges (like apt-get), so you cannot install additional packages or dependencies not already included in the App Service container image. Kudu is primarily designed for deployment and debugging, and it does not offer the same level of access as the App Service runtime.

    If your application requires specific dependencies unavailable in the Kudu environment, consider alternative approaches, such as including those dependencies in your application package or using a different container image with the required dependencies pre-installed.

     References:


0 additional answers

Sort by: Most helpful

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.