
In Azure DevOps, a wiki repository is a collaborative space for teams to store and manage documentation, knowledge bases, and project information. It's a central hub for storing and sharing information.
A wiki repository in Azure DevOps is a Git repository that stores wiki pages, which are essentially web pages that can be edited by team members. This feature allows teams to manage and update documentation in a structured and version-controlled way.
Wiki pages in Azure DevOps can be organized into a hierarchical structure, using folders and subfolders to categorize and group related content. This makes it easy to find and access specific information.
With Azure DevOps wiki repository, teams can collaborate on documentation in real-time, with features like check-in and check-out, and version history. This ensures that all team members have access to the most up-to-date information.
Prerequisites
To get started with Azure DevOps wiki repository, you'll need to meet some basic prerequisites. You must have a team project, which can be created in Azure DevOps if you don't already have one.
You'll also need to enable the Azure Repos service for your project, and have a Git repository defined in your team project. Ideally, this repo should contain at least one Markdown file that you want to publish to your wiki.
To edit wiki pages, you'll need to be a member of the team project as a Contributor, or have Basic access level to edit the project wiki. By default, the permission to publish code as wiki is set for members of the Contributors group.
Here are the specific access levels and permissions you'll need:
- Contributor: Can add or edit wiki pages
- Project Administrators group: Has the permission to publish code as wiki by default
Anyone with access to the team project, including stakeholders, can view the wiki.
Working with Pages
You can view the content of a wiki page using the az devops wiki show command, which requires the path of the wiki page, the name or ID of the wiki, and optionally includes the content of the page. The command also allows you to open the wiki page in your web browser.
To update the content of a wiki page, you can use the az devops wiki update command, which requires the path of the wiki page, the version (ETag) of the file to edit, and the name or ID of the wiki. You can also specify a comment in the commit message of the delete operation.
If you want to rename a wiki page, you'll need to follow the same naming restrictions as when creating a new page, with page titles being case-sensitive and 235 characters or less.
View a Page
To view a page, you'll need to use the az devops wiki show command in the Azure DevOps CLI. This command is required to get the content of a page.
The az devops wiki show command has several options that you can use to customize your view. The --path option is required and specifies the path of the wiki page.
Here are the required options for the az devops wiki show command:
- --path: Required. Path of the wiki page.
- --wiki: Required. Name or ID of the wiki.
You can also use the --include-content option to include the content of the page, or the --open option to open the wiki page in your web browser. Additionally, you can specify the project name or ID with the --project or -p option, or the version (ETag) of the wiki page with the --version or -v option.
Edit Page
Editing a page in a wiki is a straightforward process. You'll need to specify the path of the page, the version of the file you want to edit, and the name of the wiki.
To edit a page with inline content, you can use the `--file-path` option to specify the path of the file containing the content. This is useful if you have a lot of content to add or update.
To edit a page with content from a file, you can use the `--file-path` option along with the `--comment` option to specify a commit message for the delete operation. This is a good practice to keep track of changes made to your wiki.
Here are the options you'll need to specify when editing a page:
- --path: Required. Path of the wiki page.
- --version -v: Required. Version (ETag) of the file to edit.
- --wiki: Required. Name of ID of the wiki.
- --comment: Optional. Comment in the commit message of delete operation.
- --file-path: Optional. Path of the file input if the content is specified in the file.
Remember to specify the correct version of the file to avoid overwriting changes made by others.
Rename a Page
Renaming a page is a straightforward process. You can rename a page by changing its file name, for example, from new-home-page.md to New-Home-Page.md.
Page titles are case-sensitive, so New-Home-Page.md and new-home-page.md are considered different pages. This means you need to be mindful of capitalization when renaming a page.
Renaming a page doesn't affect its content, but it does change how it appears in the Table of Contents. For instance, a page renamed from new-home-page.md to New-Home-Page.md will show up with the label "New Home Page."
Just like file names, page titles must be unique within a folder. This means you can't have two pages with the same title in the same folder.
Publishing Code
You can publish content from a Git repository to a wiki in Azure DevOps.
To publish a Git repository to a wiki, you need to have a Git repository defined in your project. If you don't have one, create a new Git repository and then return to the page.
Select Publish code as wiki, which is located in the Repos hub. This option won't appear if your project doesn't have a Git repository defined.
You can publish up to 10 branches per published code wiki. The head of the Git repository branch is mapped to the wiki, so any changes made within the branch and selected folder(s) are automatically reflected in the wiki.
You can publish a Git repository to a wiki using the az devops wiki create command. To get started, see Get started with Azure DevOps CLI.
You can add or edit pages in the wiki in the same way that you maintain code in your Git repository. This means you can reuse your existing Markdown files and folders.
If you're done making changes, add a comment about your updates and then select Commit. The system will automatically present you with a link to create a pull request.
Here are the steps to publish your code as wiki:
- Ensure your project has a Git repository defined.
- Go to the Repos hub and select Publish code as wiki.
- Choose the repository, branch, and folder that contain the Markdown files you want to publish.
- Enter a name for the wiki repository.
- Click Publish to populate the wiki repository with the Markdown files and folders.
Managing Project
Managing Project is a breeze with Azure DevOps Wiki Repository. You can create a new wiki repository from the Azure DevOps dashboard.
One of the key benefits of using Azure DevOps Wiki Repository is that it allows for seamless version control, just like Git repositories. This means you can track changes and collaborate with team members in real-time.
To manage a project, you'll want to create a wiki repository from the start, as this allows for easy documentation and knowledge sharing among team members. This is especially useful for large projects with multiple stakeholders.
Azure DevOps Wiki Repository also supports markdown formatting, making it easy to add headings, bold text, and images to your wiki pages. This feature is especially useful for creating clear and concise documentation.
By using Azure DevOps Wiki Repository, you can simplify your project management workflow and focus on delivering high-quality results.
Repository Management
Repository management is key to a smooth wiki experience. You can publish up to 10 branches per published code wiki.
To publish a Git repository to a wiki, you'll need to select Publish code as wiki, which won't appear if your project doesn't have a Git repo defined. Create a new Git repo and return to the page to refresh it.
You can choose the repo, branch, and folder that contain the Markdown files and enter a name for the wiki repo. The Git repo must be within the team project, and you can specify the root of the repo to publish all Markdown files in the repo to your wiki.
Here's a quick rundown of the steps involved:
- Select Publish code as wiki.
- Choose the repo, branch, and folder that contain the Markdown files.
- Enter a name for the wiki repo.
- Select Publish.
The wiki repo populates with the Markdown files and folders included within the repo you selected. Any changes made within the branch and selected folder(s) are automatically reflected in the wiki.
Publish Git Repository
Publishing a Git repository to a wiki is a straightforward process that can be completed in a few steps. You need to have a Git repo defined in your project to publish code as wiki.
To get started, navigate to the Repos hub and select Publish code as wiki. This option won't appear if your project doesn't have a Git repo defined, so create a new Git repo if necessary and refresh the page.
The wiki repo will populate with Markdown files and folders included within the selected repo. The head of the Git repo branch is mapped to the wiki, so any changes made within the branch and selected folder(s) will be automatically reflected in the wiki.
You can publish up to 10 branches per published code wiki. For the provisioned wiki with extra Markdown files, you can add or edit pages in the same way that you maintain code in your Git repo.
Here are the steps to publish a Git repository to a wiki:
- Select Publish code as wiki.
- Choose the repo, branch, and folder that contain the Markdown files.
- Enter a name for the wiki repo.
- Select Publish.
Alternatively, you can use the az devops wiki create command to publish a Git repository to a wiki. This command allows you to create a wiki with the specified name and populate it with Markdown files and folders from the selected repo.
You can also publish different versions of a wiki by selecting a specific branch when publishing the code as wiki.
Update Order File
Updating the .order file is a crucial step in managing your wiki repository. This file determines the sequence of pages in the Table of Contents (TOC).
To update the .order file, you need to add or update the file for the updated folders. This action reflects the sequence of pages you want to show in the TOC.
Any files that aren't listed in the .order file will be added to the end of the alphabetical list, with their order set to int.MaxValue. This ensures that these files are displayed last in the TOC.
Command-Line Tools
To manage your Azure DevOps wiki repository, you'll want to familiarize yourself with the command-line tools available. These tools allow you to perform various actions on your wiki pages from the comfort of your terminal.
You can open a wiki using the az devops wiki show command. This is a great way to quickly access your wiki without having to navigate to the Azure DevOps website.
The az devops wiki page show command gets you the content of a page or opens a page, depending on your preference. This is super helpful if you need to reference a specific page frequently.
To add a new page to your wiki, simply enter the az devops wiki page create command. This will prompt you to enter the page details, and you're off!
You can also edit a page using the az devops wiki page update command. This is a great way to make changes to your wiki without having to manually update each page.
If you need to delete a page, use the az devops wiki page delete command. Just be sure to confirm the deletion before it's too late!
Here are the available commands for managing your wiki pages:
Frequently Asked Questions
Does Azure DevOps have a wiki?
Yes, Azure DevOps has a wiki feature that allows you to create and view project-specific knowledge bases. You can access your wiki by connecting to your project in a supported web browser or using the az devops wiki show command.
Where are Azure DevOps wiki attachments stored?
Azure DevOps wiki attachments are stored in a folder named ".attachments". This is where you'll find all the images and files linked to your wiki content.
How to clone wiki in Azure DevOps?
To clone a wiki in Azure DevOps, open the More actions context menu and select Clone wiki, then copy the clone URL to clipboard. Use the copied URL to clone the wiki in your preferred IDE.
Does Azure DevOps have a repository?
Yes, Azure DevOps has a repository feature called Git repos, which helps manage source code as your project grows. You can use Git repos to store and track changes to your code.
Sources
- https://learn.microsoft.com/en-us/azure/devops/project/wiki/add-edit-wiki
- https://learn.microsoft.com/en-us/azure/devops/project/wiki/publish-repo-to-wiki
- https://learn.microsoft.com/en-us/azure/devops/project/wiki/wiki-create-repo
- https://www.azuredevopslabs.com/labs/azuredevops/wiki/
- https://devops.stackexchange.com/questions/17276/can-you-include-an-azure-devops-wiki-inside-an-existing-repository
Featured Images: pexels.com