Using Azure DevOps Wiki Content for AI Chatbots
By Anatoly Mironov
Imagine you want to use the content from all pages in a wiki from an Azure DevOps project, perhaps for an AI chatbot or another application. In this post, I’ll share a simple Python script to load an Azure DevOps (AzDo) wiki into memory, including the markdown content and the real URLs of the pages.
Script Explanation
Here’s the script:
Limitations
This is just a simple example and not suitable for production use. Here are some limitations:
- It lacks error handling,
- it does not read the images
- it does not consider the order and page/subpage relationships - which might be important for understanding the content better.
Advantages
Despite its limitations, the script has some advantages:
- It uses DefaultAzureCredential, making it easier to work with and preparing it for running in the cloud (e.g., using managed identies).
Resources
For more information, check out these resources::
- azure-devops, a thin wrapper around the Azure DevOps REST APi. I discovered it after I started looking at the APIs. In my opinion, what I want to achieve, is better served by calling the APIs directly, which reduces the risk of potential errors.
- wikis - Azure DevOps REST API Reference, the actual api reference for wikis.
Conclusion
I hope you find this script useful for loading Azure DevOps wiki content into memory. Feel free to modify and expand it to suit your needs. Happy coding!