I created a .vsts-ci.yml file with the following contents:
steps:
- task: Docker@0
inputs:
azureSubscription: 'My Azure Subscription'
azureContainerRegistry: 'myregistry'
action: 'Build an image'
dockerFile: '**/Dockerfile'
imageName: 'hello-world:$(Build.BuildId)'
- task: Docker@0
inputs:
azureSubscription: 'My Azure Subscription'
azureContainerRegistry: 'myregistry'
action: 'Push an image'
imageName: 'hello-world:$(Build.BuildId)'
However when I run the build it fails immediately with the following error:
Step input azureSubscription references endpoint My Azure Subscription which could not be found. The service endpoint does not exist or has not been authorized for use.
I am using VSTS as well as the latest build agent (2.129.1), although it seems the build agent is not even touched at this point.
When creating a non-yaml build definition using the same values all works just fine.
@ericsciple I saved the build definition again and after fiddling a bit with the azureContainerRegistry parameter, it works just fine. Completely missed that bit of documentation. Thanks!
@bzuu thanks for comfirmation. I have struggled with presenting the content in that page in a clear manner. Let me know if you have any suggestions.
We also have an item on the backlog to have a resource authorization experience in the web editor. Something that would enable to customers to click a button to add an endpoint, and choose available endpoints from a dropdown.
Also we are also discussing adding a hyperlink in the error message. Multiple customers have run into this problem.
For anyone else who comes across this the above link is dead.
Believe it may be referring to this:
https://docs.microsoft.com/en-gb/azure/devops/pipelines/process/resources?view=vsts
Most helpful comment
For anyone else who comes across this the above link is dead.
Believe it may be referring to this:
https://docs.microsoft.com/en-gb/azure/devops/pipelines/process/resources?view=vsts