Is there anyway to run a Linux App Service locally?

Jonathon Smyth 20 Reputation points
2023-09-08T09:53:52.15+00:00

Whilst running our .Net Core application in the Azure Linux App Service, we are seeing a Segmentation Fault which results in the Service restarting causing downtime for our users. Unfortunately the tooling around debugging and logging within the Linux App Service aren't as fully featured as the Windows App Service, and our efforts to reproduce, analyse and fix the bug have been hampered by this.

We've since switched to the Windows App Service to help diagnose the issue, however we do not experience the Segmentation Fault in that environment. That does not inspire confidence that the bug is actually fixed.

I was wondering if there was a way to locally run the Linux App Service, like a docker container of sorts, so the issues of logging would be solved and we could better understand the issue we're facing on the Linux environment?

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

Accepted answer
  1. brtrach-MSFT 16,346 Reputation points Microsoft Employee
    2023-09-11T01:47:18.8066667+00:00

    @Jonathon Smyth You can run a Linux App Service locally using Docker. Azure provides a Docker container that you can use to run your Linux App Service locally. You can use this container to test your application and debug any issues that you are facing.

    Here are the steps to run a Linux App Service locally using Docker:

    Install Docker on your local machine.

    Pull the Azure App Service for Linux Docker container by running the following command in your terminal:

    docker pull mcr.microsoft.com/azure-app-service

    Run the Docker container by running the following command in your terminal:

    docker run -d -p 8000:80 -e WEBSITES_PORT=80 -e WEBSITE_SITE_NAME=app_name -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=localRoleInstance mcr.microsoft.com/azure-app-service

    Replace app_name with the name of your app.

    Access your app by navigating to http://localhost:8000 in your web browser.

    Once you have your app running locally, you can use the logging and debugging tools available in your development environment to diagnose any issues you are facing.

    1 person found this answer helpful.

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.