Flask JSON Input Validation

Creating Python Microservices, Part 2

We’ve created a simple Python microservice using Flask in Part 1. Using that as a starting point, let’s take a quick side-trip through input validation before we deploy the whole thing on Kubernetes. Code for this can be found on GitHub. Or you can use this template as a starting point. Input validation We don’t have any validation yet, so let’s add that in. We want to have a 400 error of some sort, so let’s write a test for it: [Read More]

Getting Started with Python Microservices in Flask

Creating Python Microservices, Part 1

Code for this can be found on GitHub. Or you can use this template as a starting point. The Microservice Scenario So here’s the situation: you’ve added data scientists to your team, and they’re coming up with great ideas that they’re implementing in jupyter. Lots of these new bits and pieces need to make it into the rest of your non-python system, so you decide that these small bits of logic should be deployed separately as microservices. [Read More]

Azure Sql Roles from Azure Active Directory

If your users are managed in Azure Active Directory, it’s fairly straightforward to give them Azure SQL access by assigning them to an Azure Active Directory Group: 1) Create a Group in Azure Active Directory via the Portal or command line. For example, you could name the group SQL ReadOnly 2) Assign Azure AD Users to that group. 3) Now log into the database as an administrator. Note that you need to use your own Azure login to run the subsequent commands—logging in via password won’t work. [Read More]

Compress a Folder in PowerShell for use in Linux

Fresh Tar

I wasted quite a bit of time trying to find the correct way to zip a folder in PowerShell so that it could later be extracted in a Linux docker container.

TLDR; Turns out the standard unix tar command is now standard-issue in Windows—no need to use PowerShell functions at all.

[Read More]

Clearing React Native Caches

Unable to resolve module `@blah/whatever` from `whatever.js`: Module `@blah/whatever` does not exist in the Haste module map What? ReactNative development is an endless stream of inscrutable, never-before-seen errors. The promise of RN is that a developer can stay in the TypeScript or JavaScript zone and ignore the ugly details of mobile development, but that rarely lasts for long. Those brief, lovely stretches of productive coding are frequently interrupted by long stretches of dealing with compilation errors, gradle configuration and Java or Swift dependency conflicts. [Read More]

Azure Active Directory with Azure SQL

This post describes how to set up user access to Azure SQL Server within an Elastic Pool via Azure Active Directory. Specifically, I want to allow an AD user to connect to an Azure-hosted database with his own Connection String. So you’ve got users and groups in Azure Active Directory, and you have one or more Azure SQL Servers in an Elastic Pool. How can you grant those AD Users access to your SQL Server databases? [Read More]

Wormhole! Tunnel a Firewalled Machine Onto the Web via Azure

This spring I set up a Continuous Deployment pipeline on TeamCity for a DotNet Core / TypeScript / React application which deploys to Azure. It would have been somewhat expensive to host this CD setup in the cloud, considering all the old unused hardware I have sitting in the office. I didn’t want to fiddle with the firewall to put these machines online, but fortunately it’s fairly easy to set up a tunnel to the outside without needing to touch the firewall—and that’s what I’ll be describing here. [Read More]