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!
Trouble viewing default.html on Azure
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 Static Web Apps
2 answers
Sort by: Most helpful
-
-
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.Web assembly application test result.
Test result with blazor server app.
=======================================
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