Error message
There was a resource authorization issue: “The pipeline is not valid. Job Job: Step AzureWebApp input azureSubscription references service connection Azure-Sub which could not be found. The service connection does not exist, has been disabled or has not been authorized for use. For authorization details, refer to https://aka.ms/yamlauthz."
We can retrieve a few details from the error message:
- The task is named AzureWebApp
- The field name is
azureSubscription
- The name of the Azure subscription is Azure-Sub
Possible causes
There are a few possible causes: A. The subscription has been disabled or does not exist B. The subscription has not been connected to the pipeline
This article focuses on outlining a solution for the second case, B
.
Solution: connect the pipeline to the subscription
Steps:
- Navigate to the pipeline on Azure Devops
- Go to Project Settings
- Select Service connections (see screenshot below)
- Create a new service connection
- Specify Azure Resource Manager
- Follow the instructions to connect the subscription. This may require logging into Azure.
- If the service connection was given a name, ensure this is the same name specified in the
azure-pipelines.yml
e.g if the connection is named Random-Sub, then the pipelines yaml should look like this:
- task: AzureWebApp@1
inputs:
azureSubscription: 'Random-Sub'