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

GitHub Actions部署提示成功,但Azure Web App仍显示无内容部署

Duende IdentityServer部署Azure Web App异常排查

这是我用于构建并部署Duende IdentityServer应用至Azure Web App的流水线:

name: Build and deploy .NET...
on:
  workflow_dispatch
env:
  AZURE_WEBAPP_NAME: IdpBackend
  AZURE_WEBAPP_PACKAGE_PATH: src/Web/published
  CONFIGURATION: Release
  DOTNET_CORE_VERSION: 8.0.x
  WORKING_DIRECTORY: src/Web
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Setup .NET SDK
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: ${{ env.DOTNET_CORE_VERSION }}
    - name: Restore
      run: dotnet restore "${{ env.WORKING_DIRECTORY }}"
    - name: Build
      run: dotnet build "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-restore
    - name: Test
      run: dotnet test "${{ env.WORKING_DIRECTORY }}" --no-build
    - name: Publish
      run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}"
    - name: Publish Artifacts
      uses: actions/upload-artifact@v3
      with:
        name: webapp
        path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
deploy:
  runs-on: ubuntu-latest
  needs: build
  steps:
  - name: Download artifact from build job
    uses: actions/download-artifact@v3
    with:
      name: webapp
      path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}
  - name: Deploy to Azure WebApp
    uses: azure/webapps-deploy@v2
    with:
      app-name: ${{ env.AZURE_WEBAPP_NAME }}
      publish-profile: ${{ secrets.PUBLISH_PROFILE_IDPBACKEND }}
      package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }}

流水线运行正常,日志输出:

Successfully deployed web package to App Service.
App Service Application URL: https://idpbackend-che0a9fmbhcngdc0.eastus2-01.azurewebsites.net

但访问页面时出现错误:

Your web app is running and waiting for your content

Azure门户中的日志截图:
Azure门户中部署后的Web应用日志

我用类似流水线部署API完全正常,不清楚这个问题出在哪。


排查方向:

  • 检查部署包完整性:下载流水线生成的webapp制品,确认包含web.config、程序集、静态文件/视图等完整部署文件,避免发布时遗漏关键内容。
  • 验证Web App启动命令:登录Azure门户,进入Web App「配置」→「常规设置」,确认启动命令是否适配.NET 8应用。若为自托管模式,需指定dotnet <你的应用程序集名称>.dll。
  • 查看详细启动日志:开启Web App的「诊断日志」,通过「日志流」或下载日志文件,排查应用启动时是否存在程序集缺失、配置错误等具体异常。
  • 确认部署路径:通过Kudu工具(https://<你的应用名>.scm.azurewebsites.net)查看Web App的文件结构,确认部署文件是否上传至site/wwwroot目录下。
  • 对比API项目差异:检查IdentityServer与正常API项目的.csproj配置,看是否存在PublishSingleFile、SelfContained等特殊发布设置,或依赖项处理差异。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.17 09:58:17