Adding Images in Azure DevOps Wiki

42,636

Solution 1

The wiki pages get created in their own Git repository and the image files are also added there. You can browse the repos from within DevOps at; https://dev.azure.com/MyOrganisation/MyProject/_git/MyProject.wiki

The markdown path for the image should begin /.attachments/ and make sure if you are adding dimension you use =500x and not =500 if you exclude the height e.g.

![MyImage.png](/.attachments/MyImage-98765432-abcd-1234-abcd-a1234567890b.png =500x)

Solution 2

Add image from local machine: In the wiki page editor, click 'Insert a file' icon and select image from your local pc, you will see mark-up something like: image.jpg

This will also displays preview in the editor.

Solution 3

Actually, you can now use the "Insert a file" button (represented by a paperclip icon) when editing a wiki page to upload an image.

When you upload an image this way, the image is automatically stored in the "/.attachments/" folder

Solution 4

When inserting a file in a Wiki, you initially get an image-url like blob:https://dev.azure.com/SOME-GUID. This url (when including the blob:-prefix, can be used to display the attached image in an img-tag.

<img src="blob:https://dev.azure.com/SOME-GUID" />

Centered image in Azure DevOps Wiki

If the image is important enough to be inside a Wiki page, it's probably important enough to host it somewhere you can use it inside your wiki. Have a look at creating a public container/blob in an Azure Storage account.

EDIT:
For your specific image: right-click the image and select Copy image address. You'll get an URL like this that you can use as the src of the img-tag.

https://dev.azure.com/rubdevopson/c53ed56f-c130-470b-a6ae-3c4a93266530/_apis/git/repositories/88df06c2-f627-4953-9438-0f762d4cad3a/Items?path=%2FPartsUnlimited_docs%2Fhome.png&versionDescriptor%5BversionOptions%5D=0&versionDescriptor%5BversionType%5D=0&versionDescriptor%5Bversion%5D=master&download=false&resolveLfs=true&%24format=octetStream&api-version=5.0-preview.1

Solution 5

For my side I just copy the image in the clipboard and after that on paste it generate automatically the markdown code

TLDR

CTRL+C and CTRL+V

Share:
42,636

Related videos on Youtube

Srivatsa Marichi
Author by

Srivatsa Marichi

Somewhere on Planet Earth!!!

Updated on March 31, 2022

Comments

  • Srivatsa Marichi
    Srivatsa Marichi about 2 years

    I'm trying to add a few images to the wiki in 1 of my Azure DevOps projects. When I use the absolute path as mentioned here https://docs.microsoft.com/en-us/azure/devops/project/wiki/markdown-guidance?view=azure-devops#images in the article, the images are not showing up. Any help?

    • noontz
      noontz over 2 years
      I ended here trying to resolve images in devops repos / local machine README.md with the same source. Obvious when you figure it out though: Use relative paths e.g. ![AR-Architectural](./AR-architectural.png) stackoverflow.com/questions/15764242/…
  • Srivatsa Marichi
    Srivatsa Marichi over 5 years
    Yes that's correct, but what if I have the images under the same repo? I have a bunch of documents structured within the repo as folders. So all my images are under that folder. How do I use in that case? Here is the link to see how does the repo look like with images which I'm trying to access inside wiki page: dev.azure.com/rubdevopson/_git/…
  • Srivatsa Marichi
    Srivatsa Marichi over 5 years
    Yes, I know that option. I was trying out to use the relative path to see how it supports or works :-)
  • milbrandt
    milbrandt almost 5 years
    Would be nice if the GUIDs could be replaced by human-editable names
  • Jeremy Caney
    Jeremy Caney about 4 years
    This is very similar to an existing answer from last year. In the future, please review existing answers and upvote ones that are useful before contributing a new answer. If an existing answer is mostly right, but includes a minor error, you can even edit it to suggest a correction.
  • Cleber Machado
    Cleber Machado almost 4 years
    replace all %20(space) from the link by -(dash) example: ...com/MyOrganisation/My%20Project%20Name/_git/My-Project-Na‌​me.wiki
  • Charl Botha
    Charl Botha almost 3 years
    Trying to mass export Confluence spaces here, discovered that you also CAN'T nest images in e.g. /.attachments/sub1/image.jpg, it has to be flat in that top, e.g. /.attachments/image.jpg. I wonder why this is so restrictive?
  • v-andrew
    v-andrew over 2 years
    Thanks! I was looking for image resizing.
  • Moby Disk
    Moby Disk about 2 years
    Definitely find another place to host the image because ADO deletes the image in less than a day, presumably because it can't see the markdown for the image. It will look right to the author for a little while since the browser caches the file.