azure-devops

The service connection does not exist or has not been authorized for use


I'm trying to create my first release pipeline, however I keep getting this error:

Exception Message: The pipeline is not valid. Job Phase_1: Step AzureResourceGroupDeployment input ConnectedServiceName references service connection which could not be found. The service connection does not exist or has not been authorized for use. For authorization details, refer to https://aka.ms/yamlauthz. (type PipelineValidationException)

I've tried to follow the instructions in the link, however the "Authorize Resources" button does not exist.

"Allow all pipelines to use this service connection" is already enabled and I have recreated the deployment task after enabling this.

How do I authorise the resource?


Solution

  • My "Service connection" which defined the service principal connection had been created separately to the task in my release pipeline.

    In order for "Authorize Resources" to occur, you must create a new connection from the task itself (you may need to use the advanced options to add an existing service principal).

    1. under "Azure subscription" click the name of the subscription you wish to use
    2. Click the drop down next to "Authorize" and open advanced options
    3. Click " use the full version of the service connection dialog."
    4. Enter all your credentials and hit save