无法通过管道将MEAN堆栈应用程序部署到Azure App Service

时间:2020-02-01 19:30:16

标签: node.js angular linux azure azure-web-app-service

我无法将我的应用程序部署到azure应用程序服务。我创建了一个在azure应用程序服务部署阶段失败的管道。我一直在尝试使它工作几天。我终于在部署应用程序阶段结束了它,但是当我单击URL时,它只是显示Application Error?并且我将其配置为指向正确的订阅。适用于Linux的Web App,然后选择了app-service调用gc-dev,但仍然出现错误。尝试从vscode部署应用程序时,我也遇到相同的应用程序错误。两种部署类型都可能处理完全相同的问题。还是IDK。

我感觉它与启动命令有关,因为没有什么调用ng服务来启动角度代码,但是我不确定。与该问题可能相关的另一件事是,我所有的角度服务仍然具有http://localhost:3000/api/而不是某些云URL。不确定初始页面加载是否是问题。我觉得它至少应该仍然加载登录屏幕。感谢您的帮助!

部署阶段

enter image description here

步骤如下:

steps:
- task: Npm@1
  displayName: 'install the @anguliar/cli'
  inputs:
    command: custom
    workingDir: glass/
    verbose: false
    customCommand: 'install @angular/cli -g'


steps:
- task: Npm@1
  displayName: 'install the project'
  inputs:
    workingDir: glass/
    verbose: false

steps:
- task: Npm@1
  displayName: 'build project'
  inputs:
    command: custom
    workingDir: my-app/
    verbose: false
    customCommand: 'run build'

steps:
- task: Npm@1
  displayName: 'npm install the dist/folder for express'
  inputs:
    workingDir: my-app/dist/
    verbose: false
steps:
- task: Npm@1
  displayName: 'Build the project'
  inputs:
    command: custom
    workingDir: my-app
    verbose: false
    customCommand: 'run build'


steps:
- task: AzureRmWebAppDeployment@4
  displayName: 'Azure App Service Deploy: my-app dev'
  inputs:
    azureSubscription: 'Azure subscription 1 (99c421dc-5cf5-444c-8df5-c71[![enter image description here][2]][2]02)'
    appType: webAppLinux
    WebAppName: 'gc-dev'
    packageForLinux: my-app
    WebConfigParameters: '-Handler iisnode -NodeStartFile index.js -appType node'
    enableCustomDeployment: true
    TakeAppOfflineFlag: false


1 个答案:

答案 0 :(得分:0)

嗯,一方面,这是不正确的:

WebAppName: 'My-app - Dev' 

App Service应用名称中不能包含空格。它是默认URL的一部分。

相关问题