azure - 无法在 Azure DevOps 中构建角度项目

标签 azure azure-devops azure-web-app-service devops

我有 Angular 项目,我想将其构建到 Azure Web App

我创建了这个 yaml 来构建和部署

trigger:
- main

pool:
  vmImage: 'ubuntu-latest'

steps:
- task: NodeTool@0
  inputs:
    versionSpec: '18.x'
  displayName: 'Install Node.js'


# - task: Npm@1
#   inputs:
#     command: 'install'
#     workingDir: 'schooly-angular'

- script: npm install -g @angular/cli
  displayName: 'npm install -g @angular/cli'

- script:  yarn
  displayName: 'yarn install'

- script: ng build --prod
  displayName: 'ng build'

- task: PublishBuildArtifacts@1

- task: AzureRmWebAppDeployment@4
  inputs:
    ConnectionType: 'AzureRM'
    azureSubscription: 'Azure subscription 1 (*********)'
    appType: 'webAppLinux'
    WebAppName: 'marifit-admin'
    packageForLinux: 'dist/'

但是在尝试构建时出现此错误

enter image description here

单击“授权”没有帮助

我能解决这个问题吗?

最佳答案

您似乎没有订阅 Azure 订阅 1 (*********) 的权限,或者该订阅不存在。编辑 YAML 管道时,单击设置以显示帮助>>选择您的订阅>>单击授权为此订阅创建服务连接。

enter image description here

如果授权失败,则表示您对该订阅没有足够的权限。您需要获得订阅者或所有者角色的关注。要获得相关权限,您需要获得订阅所有者的帮助。这是Assign a user as an administrator of an Azure subscription供引用。

关于azure - 无法在 Azure DevOps 中构建角度项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75007984/

相关文章:

azure - 删除最后一个 Azure 应用服务也会删除父计划

azure - 将 DotNetOpenAuth OAuth 2 与 Azure 结合使用 - 读取证书 - 提取 key 时遇到困难

java - java.lang.NoClassDefFoundError:AmqpProviderFactory.createProvider中的org/apache/qpid/proton/engine/Collector

azure-devops - 备份/恢复 AzureDevOps

azure - 如何将 Azure 应用程序网关扩展到 125 个实例限制之外?

azure - "Deployment Options"表示在 Azure 门户中禁用的 Web 应用程序

azure - Azure Web 应用服务上的 Flask + Bokeh 服务器

url - Azure 网站 - 使用 web.config 进行 URL 重写不起作用

c# - Azure - AD - AcquireTokenSilent 给出错误 failed_to_acquire_token_silently

angular - 在 Azure Web 应用程序服务中部署 Angular 通用应用程序 - 基于 Linux