【发布时间】:2020-02-21 10:57:41
【问题描述】:
我无法将我的应用部署到 Azure 应用服务。我创建了一个在 azure 应用服务部署阶段失败的管道。我一直在努力让这个工作好几天了。我终于通过了部署应用程序阶段,但是当我单击 URL 时它只是说应用程序错误?我将其配置为指向正确的订阅。 Web App for Linux,然后选择了 app-service 调用 gc-dev,但我仍然得到错误。尝试从 vscode 部署应用程序时,我也遇到相同的应用程序错误。两种部署类型都可能处理完全相同的问题。不过 IDK。
我觉得它与启动命令有关,因为没有调用 ng serve 来启动角度代码,但我不确定。可能与该问题相关的另一件事是,我所有的 Angular 服务仍然有 http://localhost:3000/api/ 而不是一些云 url。不确定这是否是初始页面加载的问题。我觉得它至少应该仍然加载登录屏幕。感谢您的帮助!
部署阶段
步骤如下:
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
【问题讨论】:
-
您在哪里托管 Anguler 前端?
-
也许这就是我感到困惑的地方。我要单独部署它们吗?我认为它会同时手动部署两者。如果是这种情况,我也单独尝试过。我将它指向 dist\\main 并且它甚至不会显示主 html 页面。它至少应该这样做。我知道如果没有后端我将无法登录,但我应该会看到一些我认为的东西
-
我看了教程,但它只涵盖了角度。我也需要使用我的 express/nodejs 服务器进行部署的帮助。我也更新了我的问题。
-
npm installstep 看起来不正确...您确定所有步骤都通过...您是否有来自 azure 门户的错误日志
标签: node.js angular linux azure azure-web-app-service