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

Azure DevOps部署后出现Application Error问题求助

Azure DevOps部署React应用至Azure App Service容器后出现Application Error

本地localhost运行React应用完全正常,但通过Azure DevOps部署到Azure App Service(容器类型)后,页面显示:

😞 Application Error
If you are the application administrator, you can access the diagnostic resources.

我的Azure DevOps部署YAML配置如下:

pool:
  name: Azure Pipelines
steps:
- task: Docker@0
  displayName: 'Build an image'
  inputs:
    containerregistrytype: 'Container Registry'
    dockerRegistryConnection: companyname
    dockerFile: dockerfile.prod

- task: Docker@0
  displayName: 'Push an image'
  inputs:
    containerregistrytype: 'Container Registry'
    dockerRegistryConnection: companyname
    action: 'Push an image'

- task: AzureRmWebAppDeployment@4
  displayName: 'Azure App Service Deploy: sigmacem'
  inputs:
    azureSubscription: 'Azure subscription 1(86f0frg6-7177-40a1-2yi5-e1fc4be92716)'
    appType: webAppContainer
    WebAppName: companyname
    DockerNamespace: 'user/companyname:latest'
    DockerRepository: 'user/companyname:latest'

对应的dockerfile.prod配置:

# build environment
FROM node:13.12.0-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY package-lock.json ./
RUN npm install --silent
RUN npm ci --silent
RUN npm install react-scripts@3.4.1 -g --silent
COPY . ./
RUN npm run build

# production environment
FROM nginx:stable-alpine
COPY --from=build /app/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

已经尝试过多种常规解决方案,但云端部署后始终无法正常运行,希望能帮忙排查问题。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.05 16:31:02