GitHub Actions is hot these days, but still, Azure DevOps is being used in many companies, and I do as well. Doctor a tool for publishing your markdown documentation on SharePoint, works nicely on Azure DevOps as well.
InfoI will use the doctor sample as the blueprint for this article.
The credentials
To start, you need to choose how you will publish your documentation to SharePoint. Doctor allows three types of authentication.
- Certificate authentication
- Username and password
- Device code
The third option is only preferred when using it on your local machine. When you want to use certificate authentication, you need to do some steps before making use of it.
ImportantThings to do before you can use certificate authentication: prerequisites for certificate authentication.
Using the credentials
On Azure DevOps, I recommend you make use of a variable group
to connect to an Azure Key Vault
. That way, all your secrets are secure and easy to be changed from one place.
InfoTobias Zimmergren wrote an excellent article about this: using Azure Key Vault Secrets from your Azure DevOps pipelines
Using a variable group is always a good idea; you do not need to manage your variables in your pipelines.
The pipeline
The pipeline itself is relatively straightforward โ the azure-pipelines.yml
file contents look like this:
|
|
Under the variables property, the variable group called doctor-sharepoint
in my case gets retrieved, which includes all the required environment variables.
The pipeline will get triggered whenever there is a push to the main
or dev
branch and does a clean-up first on main
. If you set the debug
system variable to true
. Doctor will automatically run in debug mode, which gives you extra logging.
Running the pipeline
Running the pipeline on Azure DevOps will give you the following result: