Markdown Notes with VS Code

Over the years I have managed my notes in many different ways. I’ve used Notion, OneNote, Evernote, and probably more that I don’t even remember. At the same time I was writing a lot more code, and creating documentation for web applications and APIs. This naturally got me using a whole lot more Markdown.

At this point Markdown truly is ubiquitous and it’s the defacto standard for writing technical documentation. Naturally, the more I used it the more I began to enjoy it. I started to wonder how I could incorporate it into my normal note taking activities. As an engineer, I take a lot of notes - many of them are technical in nature. It felt only natural to start using this in my normal workflow. I finally ended up settling on Visual Studio Code in combination with several plugins. I’ll take you through what I’m using, and also what I tried previously.

Read on to learn more!

Azure Certifications & Updates

It has been just about a month and a half since my first day at Microsoft! I’ll soon be in the field helping customers on their journey to the cloud. As part of my training I’ve been able to obtain three Azure certifications I’ve been looking to obtain for some time!

Azure DevOps Engineer Expert Azure Developer Associate Azure Administrator Associate

It feels great to validate my knowledge on Azure especially in the Development and DevOps areas. I’m also happy to say that I am now a Microsoft Certified Trainer! This will assist me in training customers on new Azure technologies and validates my experience in the field. As a result I’ve updated my professional profile here on the blog. I do intend to continue publishing content here, but it will still be a bit of time before that happens while I get ramped up in my new role.

The Next Chapter

I’m happy to announce that starting April 1st 2019 I will be joining Microsoft as a Senior Premier Field Engineer!

My time at Rackspace has been life changing. The past few years I had the opportunity to lead the technical vision of our Microsoft Private Cloud product, where we began to use more and more Azure to manage on premise resources. Prior to that I worked with some of our largest customers and help them make complex technical decisions about their architectures. And along the way I made some lifelong friends. But it is now time for the next phase of my career.

It’s long been a career goal of mine to join Microsoft and I feel like now is one of the most exciting times to join. Over the past 5+ years I have worked very closely with many employees at Microsoft in a variety of different programs. In my new role I will be focused entirely on Microsoft Azure Technologies. I’ll be helping customers navigate the complex landscape of cloud services so that they can have a successful journey. I can’t wait to get started!

There will be a bit more travel involved in this new role so things here will tend to quiet down a bit. But I do still intend to share my experiences and things I’ve learned along the way. I’m looking forward to the new challenge!

Purge Cloudflare Cache with PowerShell & Azure DevOps

Originally when I setup my blog on Static website hosting in Azure Storage I went with Azure CDN because I wanted to have an SSL endpoint. As of right now, you cannot do custom SSL with static website hosting unless you use Azure CDN.

But then I hit another snag, you cannot redirect the root domain and redirects in general were a bit too complex for a simple project like this one. There is a user voice suggestion for this feature but it remains under review. This started to bother me because I wanted to do redirects with SSL but couldn’t because the I could not install the certificate generated by Azure CDN on the Linux VM I decided to do the rewrites on. All my previous articles were on https://hammertime.tech breaking all of my links from places like Google and Bing, or even worse resulting in the dreaded SSL error.

Fast forward a bit to Cloudflare. In a previous life I used their free plan to protect against attack but that free plan also offers 3 free redirects AND a free SSL endpoint. This meant I could now redirect https://hammertime.tech to www. where my CNAME is setup for Azure Storage. It also meant I could redirect a bunch of my other domains like hammertimetech.com and have all my URLs work how I wanted. Nobody else will probably notice this.. but it’s one of those things I wanted in place - I am weird like that!

But I digress, now that I am on Cloudflare I wanted to make sure that the Cloudflare CDN cache has my latest content whenever I publish. This is probably overkill in some places because Cloudflare seems to pick up on new content fairly quickly. But at least at the end of my release pipeline I’ll know everything is published on the CDN.

This guide assumes a few things are already done.

  • You’ve setup a Cloudflare account and your domain is pointed to their name servers for hosting. You can find instructions in Cloudflare 101.
  • You’ve already setup your CNAME to point to Azure Storage (or other endpoint).
  • You have obtained your API Token for the v4 API
  • You already have a release pipeline setup, see my previous article for more information.

Using Azure DevOps to deploy Hexo

One of the things that I wanted to be able to do was setup a full CI/CD pipeline for my blog. As someone once said If it’s worth doing, it’s worth overdoing and it was in that spirit I configured Azure DevOps to deploy Hexo.

Overview

First off a short intro to Azure DevOps. Previously known as Visual Studio Team Services (VSTS) it is a service that allows you to manage code repositories, boards, pipelines (which we’ll cover here) and even test plans. You can also use Azure Pipelines with GitHub and while I did not do that here because I wanted all my repos to be private, there is no reason you cannot use GitHub as your source repo. Especially since two weeks ago they announced free private repos.

This article will cover the following:

  1. Configuring your build in Azure Pipelines
    • Install npm
    • Install hexo-cli
    • Generate the static site
    • Publish the build artifacts
    • Enable continuous integration
  2. Configuring your release in Azure Pipelines
    • Select your source artifacts
    • Enable AzureBlob file copy to copy content to $web
  3. Running your first build!

If you haven’t used Azure DevOps before there is an article covering how to get started.

Prerequisites

I will be assuming that a few things are already in place for the purposes of this guide.

  1. You’ll need to get Hexo configured locally and committed to a repo. I covered how to get Hexo running in the Windows Subsystem for Linux in a previous article.
  2. Your site committed to an Azure DevOps or GitHub repository.
  3. An Azure Storage Account provisioned and static website hosting enabled. This process would likely work for other services, but this article will explain how to do it with an azure account.
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×