Overview

Hey guys,

So in this one I thought I would try my hand at utilizing Azure DevOps to automate a mkdocs deployment to a static site utilizing blob service containers and Azure CDN.

Objectives

Pipeline

I wanted to create an automatic build process to allow an automated deployment of mkdocs to occur. I created the following pipeline to achieve this.

Notification

I wanted to be able to have a discord notification be sent via a webhook. You can see the PowerShell script in the above gist.

Issue

When running the AzFileCopy task which is used to copy the site files to the blob service container I was hitting an authentication issue.

Solution

  1. Navigate to the Azure DevOps project settings.
  2. Browse to "Service Connections" on the left hand menu bar.
  3. Enter the connection which you authorized when setting the AzFileCopy task settings initially.
  4. Click "Manage Service Principal"
  5. Login to Azure.
  6. Copy the display name.
  7. Navigate to you storage account > blob service container
  8. Navigate to the "Access Control (IAM) this is also known as RBAC (Role Based Access Control).
  9. Add a role assigning using the display name you copied.
  10. Assign the object the "Storage Blob Data Contributor" and "Storage Blob Data Owner"
  11. Wait 5 minutes.
  12. Re-run the pipeline.
  13. Success!! :D