Alex Brown

  • Blog
  • CV
Contact Me
  • Mocking FunctionContext GetLogger using Durable Functions Isolated Worker

    Although you can inject your ILogger<T> into the constructor of your function, sometimes you may want to use the FunctionContext from your trigger method. Mocking this for testing can be a bit tricky. Consider the following function: We want to write tests for our class. For this to be testable, we’ll need to somehow mock…

    Click or not…

    8 months ago
  • Using nginx to send webhooks to multiple upstreams

    Forwarding webhook requests from a single endpoint, to multiple ‘upstream’ endpoints could be useful in many scenarios. A lot of applications that dispatch webhooks only allow one url, however, which can be a bit of a limitation. This pattern also simplifies maintenance. For instance, you can whitelist the relay IP while keeping your upstream endpoints…

    Click or not…

    10 months ago
  • Is user-agent a privacy concern?

    Recently, I had a discussion with an e-commerce client about the implications of logging user-agents for their customers. Are there any privacy concerns involved? Can this data be used for anything other than identifying the browsers customers use to visit the site? And what about customers browsing in incognito mode – does the user-agent reveal…

    Click or not…

    11 months ago
  • This PC can’t run Windows 11

    I downloaded the PC Health Check application to make sure my new machine could run Windows 11. My confidence was high, as the specs of my machine were pretty good: Motherboard: ASUS ROG STRIX B550-F GAMING (WI-FI) CPU: AMD Ryzen 9 3900X RAM: 64GB However, when I ran the tool, to my surprise, I got…

    Click or not…

    June 25, 2021
  • Beware of Facebook Phishing scam based on ‘Local’ news

    This particular phishing scam is currently in circulation on Facebook. An account will post a clickbait news story, relevant to your local area, designed to cause panic – a child abducted, for example. (I’ve obfuscated the name / photo of this, as it’s likely the account was a compromised account – probably from a similar…

    Click or not…

    June 7, 2021
  • Cosmos DB Change Feed Processed by Azure Functions – Application Insights Telemetry

    While working with a Cosmos DB Change Feed processor running as an Azure Function,  I noticed that ‘requests’ are logged as Application Insights telemetry, but show up with no URL, and a response Code of 0. I was able to reproduce this using a lean example, generated from the func new generators. (Code available here:…

    Click or not…

    December 31, 2020
  • Satay Chicken Recipe

    Satay Chicken Recipe

    Ingredients Aprox 400g chicken thigh fillets 2tbsp peanut butter (proper stuff – 100% peanuts) 1tbsp dark soy sauce 1tsp honey Splash of boiling water (to help melt the peanut butter / make a ‘creamy’ sauce) 2 spring onions 2 cloves garlic Handful of spinach (or pak choi) To make the marinade Mix the peanut butter,…

    Click or not…

    August 4, 2020
  • How To Make Dalgona Coffee

    How To Make Dalgona Coffee

    Dalgona coffee is made by whipping equal proportions of instant coffee powder, sugar, and hot water until it becomes frothy and then adding it to cold or hot milk. It’s surprisingly easy to make. Serves 2 2tbsp instant coffee (I used Nescafe Azera Americano) 2tbsp Sugar (I used golden caster sugar) 2tbsp very hot water…

    Click or not…

    April 22, 2020
  • ‘No resources found’ error when publishing to Azure App Service using Visual Studio 2019

    Yesterday, I tried to publish an app to Azure App Service from Visual Studio 2019 (right-click -> publish) (I know, I know… but I just wanted to try this feature out!) I had already set up my Linux App Service Plan (size B1) On clicking publish, and selecting “use existing” I was seeing a rather…

    Click or not…

    March 13, 2020
  • Amazon is blocking my VPN (which is hosted on AWS!)

    I run a very simple OpenVPN server in an Amazon Lightsail VM. This is to provide me with a ’static’ IP address, I can whitelist for access to some services. However, recently, I’ve noticed Amazon (.co.uk) has been blocking me from using the shopping site when connected to my VPN. I will get the following…

    Click or not…

    December 16, 2019
  • NSwag build error – Project file does not exist / Unable to retrieve project metadata

    While working on a project that used NSwag, when the solution was built, Visual Studio (and dotnet build from the command line) reported the following error: View the code on Gist. Pretty frustrating, as it wasn’t clear what the error meant. This project used NSwag.MSBuild to generate the client on build. As per their documentation,…

    Click or not…

    November 26, 2019
  • GSuite Legacy Free Edition no longer supports email to Groups from outside domain

    One of my clients is still using the legacy free version of GSuite legacy free edition Prior to December 6, 2012, Google offered a free edition of G Suite—also known as the legacy free edition—that had a reduced set of business features. As of December 6, 2012, Google stopped offering the free edition to new customers. I followed the…

    Click or not…

    October 29, 2019
  • Tide Bank Doesn’t Send Funds From Your Account

    Until recently, Cohoda LTD held a Tide Banking account. Tide is a ‘challenger’ bank, attempting to disrupt the business banking market. There’s a major problem with this bank, however. They don’t transfer funds from your Tide account, they use a holding / intermediary account. Without telling you. We uncovered this problem when we transferred a…

    Click or not…

    September 1, 2019
  • Opening first few lines of a huge file with VS Code

    Opening first few lines of a huge file with VS Code

    I’m currently doing some work looking at the GeoNames dataset. `allCountries.txt` is around 1.5gb, which is pretty large, and certainly too large to open up in vscode for a quick look. However, I found I could use `head` command, which reads the first n lines of a file, and pipe the output to `code -`…

    Click or not…

    July 15, 2019
  • Medium Wont Add Canonical Links Despite Broken Import Tool

    Medium has to be one of the most disjointed platforms I’ve ever used. Their import tool recently stopped working, inexplicably, simply throwing this error, with no further explanation: Without the import tool, it’s impossible to set a canonical link back to the original source of the content (which should definitely be your own blog) –…

    Click or not…

    July 4, 2019
  • Using Google Sheets and Azure Functions as a headless CMS

    Using Google Sheets and Azure Functions as a headless CMS

    One of my clients came to me with a relatively simple requirement; they needed to take online payments for their fitness event photography business. The model is quite simple: There are several different competition dates per year. Competitors can purchase professional photos of themselves at a competition. Each competitor will have a ‘badge number’ to…

    Click or not…

    July 3, 2019
  • Using Mediatr with Azure Functions

    Using Mediatr with Azure Functions

    I’ve used Mediatr for some time, to reduce controller action bloat, and have spoken about it a few times, on how I use it to avoid the classic ‘xService’ pattern: Controller Action -> ‘Service’ -> Repo Lately, I’ve been doing a lot of work with Azure Functions, and would like to be able to use…

    Click or not…

    May 13, 2019
  • Registration Form Used To Send Spam Via Welcome Email

    Registration Form Used To Send Spam Via Welcome Email

    While reviewing a client site, I recently noticed a small number of accounts had registered with spurious firstName and lastName values such as: firstName:You have 5 new messages from Patty: lastName: http://www.nsbe.org/impakredirect.aspx?url=http://project1200995.tilda.ws After some digging, it appeared these customers had legitimate email addresses, however had placed no orders, nor had they interacted with our site.…

    Click or not…

    April 12, 2019
  • Reliably Processing Azure Service Bus Topics with Azure Functions

    Reliably Processing Azure Service Bus Topics with Azure Functions

    At ASOS, we’re currently migrating some of our message and event processing applications from Worker Roles (within classic Azure Cloud Services) to Azure Functions. A significant benefit of using Azure Functions to process our messages is the billing model. As an example, with our current approach, we use a Worker Role to listen to subscriptions…

    Click or not…

    March 28, 2019
  • Disable gzip responses in Azure Functions

    By default, responses from Http Triggered Azure Functions are gzipped: Not all clients are able to handle this (although they should be) Turning it off isn’t particularly trivial. A change needs to be made to applicationhost.config – which is located in LocalSiteRoot/Config However, this file is readonly, so the change needs to be made via…

    Click or not…

    March 14, 2019
  • A Seller On Amazon Offered Me An Incentive To Leave A 5* Review

    A Seller On Amazon Offered Me An Incentive To Leave A 5* Review

    I buy a lot on Amazon. Probably too much. I enjoy the convenience, pricing (mostly) and reviews. Reviews, however, have to be looked at carefully. Some sellers, particularly new sellers (or selling new products) offer incentives for 5* reviews. I knew this practice happened, but I’d never experienced it first hand. I recently bought a…

    Click or not…

    March 9, 2019
  • Some products on Amazon cost MORE on Amazon Prime, Even For Prime Members!

    Earlier today I was looking to purchase an item on Amazon. (2x VonHaus Vertical Wall Mount Bike Cycle Storage Hooks to be specific) I found them for £7.99 – available next day, on Prime. However, I noticed it was available £1 less in the “other sellers” bit. Curious, I took a look: Both same product…

    Click or not…

    January 19, 2019
  • Better assertions when verifying Moq’d methods have been called

    Better assertions when verifying Moq’d methods have been called

    Moq, according to its GitHub page, is “The most popular and friendly mocking framework for .NET”. Mocking frameworks allow you to create a ‘fake’ version of a dependency (typically an interface, or abstract class). With this fake, you can then instruct the methods return values, or invoke behaviour. Alternatively you can assert the methods were called,…

    Click or not…

    December 15, 2018
  • Reversing hashes of PwnedPasswords api using number of breaches

    I was recently working on a requirement to log the number of breached sites a password appeared on when customers were registering (if that password had been breached at all) Importantly, we are not logging the breached password itself (nor the hash of the password) – just the number of breaches that particular password appeared in…

    Click or not…

    November 16, 2018
  • Hide Sensitive Data with Application Insights JavaScript SDK using a Telemetry Initializer

    Application Insights is incredibly powerful, especially when using the JavaScript Client SDK. The problem is, sometimes we can be logging a little too much. We can use a Telemetry Initalizer to hide sensitive data in dependencies / requests logged with Application Insights.

    Click or not…

    November 16, 2018
Next Page

Alex Brown

Please don’t spam me

Contact

EMAIL: [email protected]

GITHUB: @alexjamesbrown
TWITTER / X: @alexjamesbrown