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.
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.
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.
When running the AzFileCopy task which is used to copy the site files to the blob service container I was hitting an authentication issue.
- Navigate to the Azure DevOps project settings.
- Browse to "Service Connections" on the left hand menu bar.
- Enter the connection which you authorized when setting the AzFileCopy task settings initially.
- Click "Manage Service Principal"
- Login to Azure.
- Copy the display name.
- Navigate to you storage account > blob service container
- Navigate to the "Access Control (IAM) this is also known as RBAC (Role Based Access Control).
- Add a role assigning using the display name you copied.
- Assign the object the "Storage Blob Data Contributor" and "Storage Blob Data Owner"
- Wait 5 minutes.
- Re-run the pipeline.
- Success!! :D