为什么 AzureRmWebAppDeploymen 要求我订阅,然后尝试将其用作服务连接? [英] Why does the AzureRmWebAppDeploymen ask for my subscription and then try and use it as a service connection?

查看:14
本文介绍了为什么 AzureRmWebAppDeploymen 要求我订阅,然后尝试将其用作服务连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 YAML 是

pool:
  vmImage: 'Ubuntu 16.04'

variables:
  buildConfiguration: 'Release'

steps:
- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'

- task: AzureRmWebAppDeployment@3
  inputs:
    azureSubscription: '<mysubscription>'
    WebAppName: 'mylinuxapi'
    Package: $(System.ArtifactsDirectory)/**/*.zip

订阅号在哪里

当我运行构建时,错误是

When I run the build the error is

Job Job1:Step input azureSubscription references service connection
The service connection does not exist or has not been authorized for use. For authorization details, refer to https://aka.ms/yamlauthz.

[更新]

我现在正在寻找如何添加新的服务端点

I am now trying to find how to add a new service end point

推荐答案

应该是资源授权的问题.请参阅资源并尝试使用解决方法(YAML 管道的授权疑难解答) 以解决问题.

It should be the Resource authorization issue. Please see Resources and try the workaround (Troubleshooting authorization for a YAML pipeline) to fix the issue.

某些资源必须获得授权才能使用.这确保只有拥有足够权限的用户才能访问潜在的敏感资源,例如服务连接.

Some resources must be authorized before they can be used. This ensures that only users with sufficient permissions can access potentially sensitive resources such as service connections.

资源授权

当您保存管道时,资源授权会检查新的和更新资源.如果您无权授权一项或多项资源,则保存管道将失败.

When you save a pipeline, resource authorization checks for new and updated resources. If you lack permission to authorize one or more resources, then saving the pipeline will fail.

如果向现有 YAML 管道添加新资源,Azure管道将接受更改但可能无法授权资源.您的构建可能会失败,直到您使用授权资源下面的故障排除步骤.

If you add a new resource to an existing YAML pipeline, Azure Pipelines will pick up the change but may not be able to authorize resources. Your builds may fail until you authorize resources using the troubleshooting steps below.

对 YAML 管道的授权进行故障排除:

当您向管道添加新的服务端点或其他资源时,它必须经过授权才能工作.如果构建失败并显示有关资源授权的错误消息,请按照下列步骤操作:

When you add a new service endpoint or other resource to a pipeline, it must be authorized before it will work. If builds fail with an error message about resource authorization, follow these steps:

  1. 导航到网络中的管道.
  2. 将默认分支切换到包含新的分支服务端点引用.
  3. 保存管道.
  4. 恢复到原来的默认分支并保存管道

这篇关于为什么 AzureRmWebAppDeploymen 要求我订阅,然后尝试将其用作服务连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆