How to fix error "No webpage was found for the web address:" when I am opening the url for my app service.

Rajneesh Yadav 30 Reputation points
2023-05-18T08:39:43.7833333+00:00

Hi community,

I have created one dotnet core web app. Pushed it to repos in azure devops, created a pipeline and deployed it on azure web app services. After creating the release and publishing it on web app, when I am trying to open the URL of web app, I am getting error like "No webpage was found for the web address:", Error:404.

Please help me with it.

Azure SQL Database
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,609 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,902 questions
{count} vote

Accepted answer
  1. JasonPan - MSFT 5,906 Reputation points Microsoft Vendor
    2023-05-18T09:51:23.2833333+00:00

    Hi @Rajneesh Yadav,

    You need to use your app name to replace app_name, the url and api are templates. You need to make sure you have the api method and using correct url to test it.

    Please let me summarize, the problem with 404 encountered when deploying webapp to azure app service.

    1. First of all, we need to confirm whether the project contains view pages or webapi. Because swagger ui is generally used in the development environment, it usually disappears after publishing to azure, which is the expected behavior.
    2. If it contains view pages, then we need to log in to the kudu site (https://app_name.scm.azurewebsites.net), go to the wwwroot folder, and check whether the published files are complete. You can also publish the published files that run well locally by dragging and dropping.

    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,

    Jason Pan

    5 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Linda Belebesi 45 Reputation points
    2023-08-28T06:56:44.05+00:00

    Hi JasonPan - MSFT

    I commented the local code as below as per your suggestion and then republished it to Azure and it is now working fine. I appended /swagger on my azurewebsites.net URL and I could access my cloud web Api.

    User's image

    // Configure the HTTP request pipeline.
    //if (app.Environment.IsDevelopment())
    //{
          app.UseSwagger();
          app.UseSwaggerUI();
    //}
    
    1 person found this answer helpful.
    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    2 deleted comments

    Comments have been turned off. Learn more

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.