Too many redirects with Cloudflare + Azure App Service

Too many redirects?! Why I spent far too long troubleshooting why a perfectly good, HTTPS enabled Web Application hosted on an Azure App Service failed after moving the DNS (proxied) over to Cloudflare. The App Service wasn’t doing anything I would consider non-standard. Simple site with a custom domain, correct SSL bindings and just a free “App Service Managed Certificate”. Symptom was simply ERR_TOO_MANY_REDIRECTS like so: I’ve since learnt this typically happens because both Cloudflare and Azure are trying to handle SSL/TLS termination and redirects....

January 25, 2025 · 2 min · 298 words · Dave Hogan

Reflecting on the need for Abstracting DateTime.Now

Unit Testing Newbie When I first started taking unit testing more seriously (it was 13+ years ago, don’t fight me!) I didn’t understand how to test something when I was using DateTime.UtcNow. My tests worked then failed a while later. I asked, on reflection, an embarrassing question on Stack Overflow. What made it embarrassing was that it showed my lack of understanding of non-deterministic values and testing code that used them....

January 24, 2025 · 3 min · 508 words · Dave Hogan

Rewriting Entire Git Branch into a Single Commit

Squishing Everything Back to a Single Commit in Git Ever wanted your Git history to go back to the initial commit while preserving the content you have today? For example, maybe you’re making a private repository public and want to remove the commit history but keep the current state. While a better option might be to create a new repository and commit everything fresh, if you really need to do this, here are the steps I took recently....

August 21, 2024 · 3 min · 468 words · Dave Hogan

Gitflow Branching Strategy

This post was taken from a rough gist I created whilst strategising a GitFlow branching strategy in a new team setting. Views may have likely changed since then and no on-size fits all. Introduction However you and your team manages branches; it’s important to have at least some kind of strategy that everyone adheres to. Rules and process should be designed to keep things consistent within the team and changes flowing to avoid complex merges and other such issues with multiple work steams on a single code repository....

August 15, 2024 · 8 min · 1619 words · Dave Hogan

Bundling and Minification in ASP.NET Web Pages

This post was taken from a rough gist I created whilst battling bundling and minification back in Nov ‘23. Things have likely changed since then. What is it? Bundling and minification are optimisation techniques used to improve the performance of web applications. Mainly by reducing the number of HTTP requests and decreasing the overall payload transmitted over the wite. We would typically do this for as many of our site-wide CSS and JavaScript files....

August 15, 2024 · 3 min · 578 words · Dave Hogan