Uploaded content from web pages is not showing up

Lib480 20 Reputation points
2023-08-26T03:45:19.93+00:00

Hi Community,

This is my first post. I'm a student and taking a web development course at a college. It's part of my assignment to create a web app from the create resources tab and then upload a web page. Create web app and provide a name for the website. When I type my website URL in the browser, I can get a message "Your web app is running and waiting for your content". I thought all was set, and now I need to upload pages. I created the first index.html page from my computer using VS code. I installed Azure extension from VS code and tried to deploy the page, however I got an error, and I googled the error but couldn't figure it out. So I installed FileZilla and and connected to the website. I could connect, and there was already a file "hostingstart.html". I deleted the file and I uploaded my index.html file and website logo. It has been more than 30 minutes, and it's not showing my page and still showing the content of the builtin page event. I deleted that page from the wwwroot directory. I am still new and don't have an idea what else need to do. Can someone please help? Thank you!

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,178 questions
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2023-08-31T08:27:49.5666667+00:00

    @Lib480

    Upon the deployment of an Azure Web App, also referred to as an App Service, a couple of key actions take place:

    1. By default, the web app is directed to opt/startup/hostingstart.html.
    2. A hostingstart.html file is placed in home/site/wwwroot.

    When your code is deployed, the hostingstart.html file in home/site/wwwroot is replaced. However, the web app still maintains its reference to opt/startup/hostingstart.html. This becomes evident if you remove the opt/startup/hostingstart.html file – your web app will generate a "CANNOT GET/" error.

    If you wish to modify this default behavior, the process is simpler than it may seem:

    1. Navigate to the Configuration section of your web app.
    2. Integrate the following code into the startup script:
    
    pm2 serve /home/site/wwwroot --no-daemon
    

    By implementing this command, the web app will serve the contents of the wwwroot folder.

    In the event that this web app functions as a single-page application on the client side and you're encountering challenges with routing, you can augment the above command as follows:

    
    pm2 serve /home/site/wwwroot --no-daemon --spa
    

    This adjustment includes the "--spa" parameter, which aids in managing routing issues.

    User's image

    See- https://learn.microsoft.com/en-us/azure/app-service/configure-language-nodejs?pivots=platform-linux

    Let us know if further query or issue remains.

    2 people 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.