How to automate Azure App Service deployment slots for dev/staging environments

About Deployment Slots

Azure web app service has a fantastic feature called “Deployment Slots”, available on standard or premium mode pricing tiers. This feature allows you to spin up multiple slots (full instances) of your web application for test/development and staging uses.
Continue reading

Azure PowerShell cmdlets and connectivity basics

Background

I will be writing about some Azure features and related automation in upcoming blog posts. This post can be a quick reference for anyone unfamiliar with how to get up and running with Azure PowerShell. That includes installing and updating the cmdlets, and how to connect to your Azure resources via PowerShell.
Continue reading

How to find users near a central coordinate (spatial nearest neighbor queries)

Scenario

You have a database table of users who have a location specified. Given an input location point, coordinate, or city – find the top N (or all) of the nearest neighbors in range. So for example, if I am in Seattle, return 15 nearest users to my location within a 50 mile range. This is a classic spatial/geography scenario with many applicable uses. I used this technique when building some Tourvival features.

Setup

Our example uses Microsoft SQL Server, or SQL Azure database. Let’s start by making an example users table.
Continue reading