There's no instructions on how to use or specify these resources in YAML
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@andyjlewis this should go on your backlog, I believe.
Does this mean YAML builds cannot be used by Pull Requests? I can't authorize the temporary branch created by a Pull Request ahead of time.
You can, I am just pointing out that it is not documented or at least not well. What I do as a work around is use the graphical one and convert it to YAML and copy the block that had the resource IDs.
For anyone looking to use an authorized SSH service connection in YAML:
The connection can be established by going to Project Settings (bottom left in DevOps) > Pipelines > Service Connections > New Service Connection > SSH. There you can either use a user password or upload a private key for the connection. You do not need store these secrets anywhere else but the connection.
If you don't know how to use the service connection in YAML, go ahead and create a new empty pipeline graphically, add the task you want to use to it (in my case the SSH Deployment one) and use the UI to select the service connection. Then click on View YAML and place that to your pipeline YAML file. Example:
- task: SSH@0
inputs:
# Manage service connections in Project Settings > Pipelines > Service Connections
sshEndpoint: myConnection # The name you've given to the connection
commands: "echo 'test'"
I am working on master directly, if you are doing this in a feature branch, you will need to follow the instructions at https://aka.ms/yamlauthz. Hope this helps anyone!
In my case I needed the connections to a Maven repository so that's not possible without using the secrets.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This topic was refreshed from a YAML perspective recently. Closing this out.
Why is this closed? There does not appear to be any documentation on what parameters or how to use them when calling resources: in the yaml. Do we just guess? or do we have to dive into the code to try to work it out?
@calum-hunter Thanks for the quick follow-up. We're conducting an audit of open issues against at the moment and I mis-interpreted the full scope of the request.
resources: is documented in the schema, under templates, and under container jobs. That's all they do at the moment, so I'm not sure what more we could document there.
I left this open thinking we could document non-resources things like service connections, which I'm doing now.