Trouble viewing default.html on Azure

Aaron Richards 0 Reputation points
2023-12-22T00:15:02.5066667+00:00

I created a "Hello World" page named default.html in VS2022 in the wwwroot folder. It works on local VS IIS, but I get a "No webpage was found for the web address" error on Azure. The default blazor page works on Azure. When I try to view https://azurehelloworld20231221111616.azurewebsites.net/default.html, it says page can't be found on Microsoft Edge and on Chrome. I want to view the default.html file on Azure, but I don't know what's wrong. I just started using Azure yesterday. Can someone help me out?

Developer technologies .NET Blazor
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,173 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Aaron Richards 0 Reputation points
    2023-12-22T00:29:05.1533333+00:00

    OK, found a solution. Still not sure what the problem was. I published the default.html file by itself, referenced it in the browser, and bingo! It Worked! Never selected the Exclude from Publishing option, so I don't know why it didn't publish by default. But hey! I am a happy camper! Thank you all for considering assisting me!


  2. Anonymous
    2023-12-22T07:31:02.0733333+00:00

    Hi Aaron, I'm glad to see you can visit your static html in Azure now, but since we don't have detailed information about what you did so I can just try to explain what you met.

    Firstly, no matter you are having a blazor web assembly app or blazor server app, you all need to use the routing module inside it so that you could reach corresponding component. For the static html files inside the blazor app, per my testing with .net 7 blazor server and blazor stand-alone web assembly project, both of them are able to visit the html files inside wwwroot folder by default, the same after publishing to Azure. I noticed that you are using xxx.azurewebsites.net as the url so you are having an Azure web app but not the static web app(xxx.azurestaticapps.net). So I also created a .net 7 azure web app for testing.

    The error message you got it says page can't be found on Microsoft Edge and on Chrome, I suggest you to checking in the kudu(xxx.scm.azurewebsites.net) to see if the default.html was existed inside the site/wwwroot path. If it's missing, we can manually add the file by clicking the "+" icon inside the screenshot below to add this html file, then the issue might disappear.

    User's image

    Web assembly application test result.

    User's image

    User's image

    Test result with blazor server app.

    User's image

    =======================================

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,

    Tiny

    0 comments No comments

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.