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

查看:151
本文介绍了为什么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

订阅ID在哪里

当我运行构建时,错误是

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

推荐答案

应该是资源授权问题.请参阅资源并尝试解决方法(

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. 还原回原始的默认分支并保存管道 再次.
  1. Navigate to the pipeline in the web.
  2. Switch the default branch to the branch that includes the new service endpoint reference.
  3. Save the pipeline.
  4. Revert back to the original default branch and save the pipeline again.

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

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