I want to download Work Item details from our Azure DevOps Services instance and push it into our local TFS Server.
I got as far as connecting to the DevOps server using the WorkItemTrackingHttpClient in C#. I can iterate through the work items i find and can see the fields, download attachments using GetAttachmentContentAsync. So far all good.
The last detail i need to complete this is to also copy/download the embedded images that are in the HTML Description fields. I can extract the HTML code from the HTML field and see one or more img src lines in it.
<img src=\"https://dev.azure.com/tenant/projectguid/_apis/wit/attachments/d928c8ee-f493-4d30-99a5-f62b7f36a2f7?fileName=grafik.png"\>
All of these have the fileName grafik.png, but a different fileGuid.
I tried to use the GetAttachmentContentAsync to download on this guid, but that did not work. I tried to download the file using a normal Stream, but that didnt work, i assume this is due to authentication. The image files also do not show up as a normal attachment.
So the question is, how can i download this image from Azure DevOps from my C# client, which is authenticated using a PAT through the API. Is there an API call i can use to download this file ? i have not been able to find it, or can i somehow authenticate the WebClient with that PAT so that it can download it ?