I'm trying to upload a build artifact to my Azure DevOps pipeline using the REST API: https://learn.microsoft.com/en-us/rest/api/azure/devops/build/artifacts/create?view=azure-devops-rest-7.1
But it's not clear from the documentation how to use this method. Especially ArtifactResource entity
I tried to use it, but it create some empty artifact in the pipeline, not clickable and without the content.
It would be great to have some usage examples.
Thanks
From your description, it seems you want to create a pipeline artifact and it's contents directly via REST API?
If so, it is unable to achieve. As the official document mentioned:
This 'Create' is not as you thought. It needs an existed pipeline artifact.
Artifact of the pipeline is based on azure storage, but this storage is invisible.
what is the purpose of the "data" field there?
This field needs a path of the artifact that already exists.
what are the possible values for "type" field?
There are many types, since you can't create artifact directly, you need to use get-artifact to know the type you need to set.
How the body of the file will get to the server? Will the DevOps download the body from the URL specified in "Url" field?
Not, the UI will get the data from the data part not the url part, if can't find the path on the related storage of DevOps, you will see nothing.