You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Web Apps部署后显示微软默认页,如何修改应用服务主页?

Fixing Azure Web Apps Showing Default Page & Setting Your Custom Homepage

Hey there! I’ve run into this exact issue dozens of times—deploying an app to Azure Web Apps only to see that generic Microsoft welcome page instead of your hard work. Let’s break down why this happens and how to fix it, plus how to set your app’s homepage properly.

Why You’re Seeing the Default Page

First, let’s troubleshoot the root cause:

  • Deployment didn’t target the right folder: Azure looks for your app files in the wwwroot directory. If your deployment tool (like GitHub Actions, Azure CLI, or VS Code) uploaded files to a subfolder inside wwwroot (e.g., wwwroot/my-app), Azure can’t find your entry point. Check the deployment logs or use the Kudu console (go to your-app-name.scm.azurewebsites.net) to verify files are in the root of wwwroot.
  • Default document doesn’t match your homepage: Azure checks a predefined list of default filenames (like index.html, default.html, index.php) in order. If your homepage has a different name (e.g., home.html), Azure skips it and shows the default page.
  • Incorrect startup command (for dynamic apps): For Node.js, .NET, Python, etc., if your app’s entry file isn’t the default expected by Azure (like app.js for Node), it won’t start properly, falling back to the welcome page.

How to Set/Change Your App’s Homepage

Let’s cover the most common scenarios:

1. Update Default Documents via Azure Portal

This is the go-to fix for static sites or apps where your homepage is a static file:

  • Go to your Azure Web App in the portal.
  • On the left sidebar, click Configuration > Default documents.
  • Click Add and type the exact filename of your homepage (e.g., home.html, landing-page.html).
  • Use the up arrow to move your new entry to the top of the list—Azure checks files in order, so putting yours first ensures it’s prioritized.
  • Save the changes and restart your Web App.

2. Set Startup Command for Dynamic Apps

For apps like Node.js, .NET Core, or Python where you need to run a server:

  • Node.js: If your entry file isn’t app.js or server.js, either update your package.json to include "start": "node my-custom-entry.js", or go to Configuration > General settings in the portal, and enter node my-custom-entry.js in the Startup command field.
  • .NET Core: Ensure your Program.cs has the correct routing setup (e.g., mapping to your homepage controller). Alternatively, in the portal’s Default documents list, add your app’s default route filename (like Index.cshtml if using Razor Pages).
  • Python: Set the startup command to point to your WSGI app, e.g., gunicorn --bind=0.0.0.0 --workers=4 my_app:app.

3. Fix Subfolder Deployments

If your app is deployed to a subfolder inside wwwroot:

  • Go to Configuration > Virtual applications and directories in the portal.
  • Click Add to create a new entry:
    • Virtual path: Enter / (to map the root URL to your subfolder).
    • Physical path: Enter site\wwwroot\your-subfolder-name (replace with your actual subfolder).
    • Uncheck Convert to application unless you need it for a separate app.
  • Save and restart your Web App.

Once you make these changes, give your Web App a quick restart—this ensures Azure picks up the new settings. In most cases, your app’s homepage should load right away!

内容的提问来源于stack exchange,提问作者Deepak Bolla

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 08:57:16