Why does the AzureRmWebAppDeploymen ask for my sub

2019-01-29 12:58发布

My YAML is

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

Where is the subscription 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.

build error

[Update]

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

1条回答
孤傲高冷的网名
2楼-- · 2019-01-29 13:24

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.

Resource authorization

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.

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.

Troubleshooting authorization for a YAML pipeline:

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. 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.
查看更多
登录 后发表回答