RSSAmplifier

Blog

James Sturtevant

jamessturtevant.comRSS feed ↗95 posts

Latest posts

Practical Ways AI Can Help You Today with Minimal Setup

There is a lot of hype around AI right now, and I was a skeptic for a long time as many close friends know. In the past it required precise prompts that were long-winded, and even then you didn’t always get the result you wanted. During my early attempts I found that I could often just do the task manually faster than I could with AI. But I have been periodically trying new techniques and watching…

Attaching a debugger to a Windows Containerd shim

Containerd provides a mechanism that allows runtime authors to integrate with containerd via the shim api . The general way this works is that containerd invokes a binary on the host then communicates via an IPC channel that works for a the operating system (namedpipes on windows). There is a lot of details in the readme but that is the gist. It can be tricky to debugging the runtime is that since…

Setting up the Rust debugger with VS Code on Windows and Linux

When setting up the Debugger for Rust in VS Code you have two options depending on which operating system you are running on. The rust analyzer extension doesn’t support debugging out of the box you must install one of the following: C/C++ for Visual Studio Code - use with Windows CodeLLDB - use with Linux Once you have those installed, running tests and console applications are easy to get…

Windows I/O completion - One little trick

I’ve been learning how to deal with I/O Completion ports for my latest project and found a few libraries that manage it all for me but I was getting strange behavior, So I ended up having to dig deep enough to understand what was happening. I didn’t find a really clear post so here is my attempt. When I was reading some of the code I found all had slightly different ways of accomplishing detection…

Rust Traits are not interfaces (and a little on Lifetimes)

I have been learning rust lately. I eventually came to some clarity (hopefully) after reading lots of different sources so I’ve compiled there here with some commentary. Note: I am still learning so please let me know if I’ve got something not quite right. This is my current understanding and your mileage may vary. Using Traits for dynamic implementations My first approach to using traits was to…

Running Windows Unit tests for Kubernetes on Windows

Most of the kubernetes build tooling doesn’t work on Windows but we do have unit tests written for Windows components. These unit tests must run on a Windows machine. So how do you run them if the build tooling doesn’t work? Manually From a Windows machine you can manually run them: go test . -mod=mod -run listContainerNetworkStats If you want to build build them on Linux then run them on Windows.…

Helpful Cluster API commands for Devs

If you are doing development or working with Kubernetes cluster api these are some helpful tips. Handy tools clusterctl - helps with cluster creation but more importantly cluster debugging kubie - allows you to connect to multiple clusters at same as well as switch namespaces and clusters quickly. Helpful becuase it lets you be connected to both the management cluster and the workload cluster.…

Track active file in Goland

In a large code base it can be hard to figure out where files are. I’ve always enabled the “track active file in project drawer” in Visual Studio and VS Code. I’ve become a big fan Goland recently and found it hard to find this setting. So here it is:

Windows Containers on Windows 10 without Docker (using Containerd)

I have been working on making containerd work well on Windows with Kubernetes. I needed to do some local dev on containerd so I started to configure my local machine. I found lots of information here and there but nothing comprehensive so I wrote down my steps. Note there are a few limitations with containerd (so you might not want to fully uninstall Docker). For instance, containerd doesn’t…

Debugging CNI and Kubelet in Kubernetes

I have been working on adding IPV6 support to the Azure cluster api provider (CAPZ) over the last few weeks. I ran into some trouble configuring Calico as the Container Networking Interface (CNI) for the solution. There are some very old ( 2017 ) and popular ( updated 13 days ago at time of writing) issues on github where folks are looking for ways to fix the issue. This is obviously something…

Deploying AKS with least privileged service principal

When deploying an Azure Kubernetes Service cluster you are required to use a service principal. This service principal is used by the Kubernetes Azure Cloud Provider to do many different of activities in Azure such as provision IP addresses, create storage disks and more. If do not specify a Service principal at the time of creation for the an AKS cluster a service principal is created behind the…

Using the Go Delve Debugger from the command line

Yesterday I had to revert to the command line to debug a program I was working on (long story as to why). I was initially apprehensive to debug from the command line but once I started I found the experience was quite nice. In fact I would compare debugging from the command line like “Vim for debugging”. Best part was I found the bug I was looking for! I was working in Golang so I used the awesome…

Azure Kubernetes Metric Adapter

NOTE: This project is no longer actively maintained and some of the information might be outdated. Please checkout KEDA . The scenarios described below have been ported to that project. TLDR; The Azure Kubernetes Metric Adapter is a experimental component that enables you to scale your application deployment pods running on any Kubernetes cluster using the Horizontal Pod Autoscaler (HPA) with…

Checking the Aks Acs-Engine version number for debugging

Azure Kubernetes Service (AKS) uses the acs-engine project behind the scenes. Acs-engine is used as place to prototype, experiment and bake features before they make it into AKS. I was recently working on a project where we using AKS shortly after it went General Availability (GA). We saw strange behavior on our test cluster related to provisioning volume mounts and load balancers that we could…

Windows Containers Cheat Sheet

I have been using windows containers a lot in the last month and the other day I was asked how to do something. I don’t remember anything, I use a combination of GitHub, OneNote, and Bingle (Bing/Google) for that, so of course I started looking for the various examples in various GitHub repo’s that I’ve used and written. Turns out this is not very efficient. Instead, I am going to create this…

Creating a Secure Service Fabric Cluster in two commands

Creating a Secure Fabric cluster in Azure has become easier. Currently if you use the Azure Cli you can do it in only two commands. Note that you may wish to change the location or operating system parameters. az group create --name <resource-group-name> --location eastus az sf cluster create --resource-group <resource-group-name> \ --location eastus \ --certificate-output-folder . \…

Running Kubernetes Minikube on Windows 10 with WSL

Sometimes you want to be able to deploy and develop applications locally with out having to spin up an entire cluster. Setting up Minikube on Windows 10 hasn’t been the easiest thing to do but with the help of a colleague, Noel Bundick and GitHub issues , I got it working this week so this post is for me in the future when I can’t remember how i did it :-). Install Minikube This part is pretty…

Validating and Registering an Azure Event Grid WebHook in Node.js

The accompanying source code can be found at https://github.com/jsturtevant/azure-event-grid-nodejs . It is possible to register your own webhook endpoint with Azure Event Grid . To do so you need to pass the Event Grid Validation process which happens when you first subscribe your endpoint to a Event Grid Topic. At subscription time, Event Grid will make a HTTP POST request to you endpoint with a…

Using Helm to Deploy Azure Functions on Kubernetes

In the previous post on running Azure Functions on Kubernetes we deployed everything using manual commands. To improve upon the solution, I created a Helm Chart that enables you to deploy the Function Application. There are a few advantages to this: Simplified upgrades Simplify the deployment of multiple Functions Simplify the CI/CD of multiple Function App Checkout the chart at…

Running the Azure Functions Runtime in Kubernetes

This is a two part series. The second post is on Deploying an Azure Function App to Kubernetes using a Helm Chart. The Azure Functions team recently released the preview of Azure Functions on Linux . A colleague Vy Ta and I thought it would be fun to see if we could get Azure Functions running in Kubernetes. Here are the steps to get it work. To follow along you will need to have: .NET Core 2.0…

Creating a Finite State Machine Distributed Workflow with Service Fabric Reliable Actors

The accompanying source code can be found at github.com/jsturtevant/azure-service-fabric-actor-fsm . I recently had to manage a long running workflow inside Azure Service Fabric solution. I remembered reading about using a Finite State Machine (FSM) with Actors in the book Programming Microsoft Azure Service Fabric by Haishi Bai. When I went looking for examples of how I might use a FSM with the…

Training links for Microsoft and Azure

I often get asked how to get trained up on a given Microsoft technology. Like anything, there is a lot of info out there, so here is a consolidated list where I would get started. You can go to each resource and search for the technology you are interested in. I always start at the free tier then work up from there if I feel I need/want more. Microsoft Virtual Academy (free) Good for full overview…

Setting Global Shortcuts for Bash for Windows

I have started using Bash for Windows as part of my workflow. For a long time, I have been using the standard command prompt with Git Bash tools hooked up to my path (using chocolately to install the tools in one command choco install git -params '"/GitAndUnixToolsOnPath"' ). This was nice because I could use the shortcut Windows Key + X then C to open a command prompt and get access to Linux like…

Deploying a Service Fabric Guest Executable with Configuration File

In Service Fabric, when your guest executable relies on a configuration file, the file must be put in the same folder as the executable. An example of an application that that needs configuration is nginx or using Traefik with a static configuration file. The folder structure would look like: |-- ApplicationPackageRoot |-- GuestService |-- Code |-- guest.exe |-- configuration.yml |-- Config |--…

Using the Visual Studio Team Services Agent Docker Images

There are two ways to create Visual Studio Team Services (VSTS) agents: Hosted and Private. Creating your own private agent for VSTS has some advantages such as being able to install the specific software you need for your builds. Another advantage that becomes important, particularly when you start to build docker images, is the ability to do incremental builds . Incremental builds lets you keep…

Accessing Docker Swarm Secrets from ASP.NET Core

Docker Swarm introduced Secrets in version 1.13, which enables your share secrets across the cluster securely and only with the containers that need access to them. The secrets are encrypted during transit and at rest which makes them a great way to distribute connection strings, passwords, certs or any other sensitive information. I will leave it to the official documentation to describe exactly…

Deploying a Python Website to Azure with Docker

This post will cover how to deploy a Python Website to Azure Web Apps for Linux using python. With the release of Web Apps for Linux it makes it easier to deploy any application to Azure Web Apps. Before Web Apps for Linux there needed to be explicit support for a language in Azure or you had to create a complicated Kudo Extention to enable a language. For many languages, it also means you need to…

Debugging ARM Templates with Custom Scripts

A while back I was working a one-click Azure Deploy button for the Hoodie sample application . If you have not seen Hoodie before you should check the project out. It is an opensource project with a complete backend that allows front end developers to build amazing applications and they have a great community . ARM Template Debugging Issues I ran into an issue during development and testing of the…

Build and Deploy an opensource project with Visual Studio Team Services without sharing secrets

When working with an opensource project it is important to not keep the keys in your source control, otherwise this happens . We all know we need to keep the secrects out of public source code but how do have a Continuous Integration/Continuous Deployment setup in the case of an open source project? One solution to keep secrets out of the source code is to use envirornment varibables. At runtime…

Making Http Web Requests in Unity with CSharp

This past weekend I was able to partcipate in Hack Harvard 2016 as a mentor. Hackathon are always a great time and this year there were some really great hacks ranging from solving social media bullying to auto populating calendars to a portable translator. I got to work with lots of great teams on lots of problems but there is one that I wanted to make sure got documented. Thanks to Moaaz Elsayed…

Failed Build in Visual Studio Team Services after Xamarin upgrade

This week I updated Visual Studio’s version of Xamarin. All was well until I kicked off a build for my Andriod project in Visual Studio Team Services (VSTS). During the Build Xamarin.Android Project step I recieved the following error and my build failed: C:\Program Files (x86)\Java\jdk1.6.0_45\\bin\javac.exe -J-Dfile.encoding=UTF8 -d obj\Release\android\bin\classes -classpath ....…

ASP.NET Core cannot find runtime for Framework '.NETCoreApp'

Today I upgrade my ASP.NET Core application from version 1.0 to version 1.0.1 because of a bug in Entity Framework . Right after updating to the latest ASP.NET Core version, I built the project but ended up with the following error in Visual Studio: Can not find runtime target for framework '.NETFramework,Version=v4.5.1' compatible with one of the target runtimes: 'win10-x64, win81-x64, win8-x64,…

Service Fabric ASP.NET Core could not load file or assembly ServiceFabricServiceModel

After adding a reference to retrieve a Service Fabric Actor to my ASP.NET Core Web API project I got the following error when making the call to create the actor using IMyActor actor = ActorProxy.Create<IMyActor>(actorId, serviceuri); : System.IO.FileNotFoundException: Could not load file or assembly 'ServiceFabricServiceModel, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or…

Running Scripts Pre and Post Publish in ASP.NET Core RC2

This week I ran into an issue when deploying a Service Fabric service where a library file was not being copied to the output directory . Since I am using ASP.NET Core for my API layer in the Service Fabric project, I had to go dig around to figure out how to get the file to copy to the deployment folder during the publishing of the ASP.NET Core application . note that this solution with…

Integrating ASP.NET Core with Service Fabric using ICommunicationListener

At the time of writing there is no official template for integrating ASP.NET Core (RC2) with Service Fabric in a Stateless Service so I though I would dive in and see if I could get it to work by looking at the ASP.NET 4.6 Web API Template that is currently available through Visual Studio. There will be a ASP.NET Core template available eventually but I thought this would be a useful exercise to…

Starting the Service Fabric Local Cluster Manager

I have had to start the Service Fabric Cluster Manager a few times without starting Visual Studio and deploying the application for talks or demos. Since the Cluster Manager is a separate process there is no need to run Visual Studio, simply: Open the Windows Run Dialog ( Windows Key + R ) Type ServiceFabricLocalClusterManager.exe and hit OK Now your local Service Fabric Cluster is running and you…

5 Ways to Install Git on Windows

Git is a major part of a developers work flow these days no matter what platform you work on. There are many different ways to install and use Git on Windows and in this post I will cover 5 different ways and talk about the pro’s and con’s of each. At the end you should have a good idea of how to have a great experience with Git on Windows not matter what your scenario. Be sure to let me know your…

Accessing Azure Service Fabric Virtual Machines

Azure Service Fabric is a manage service that abstracts the server infrastructure away from you. You give Service Fabric the application composed of services and it decides what machines to run the individual services on (this can be customized on CPU/memory/etc via configuration . If a machine goes down it will automatically redistribute the loads, wait till the server comes back online then…

Dependency Injection with Service Fabric

In my previous post I talked about how Azure Service Fabric went to General Availability in Azure and why it was important. Since then I have been diving deeper on Service Fabric and I will be giving a talk on it at ContainerDays Boston 2016 next week. Today we are going to talk about how to wire up dependency injection in Service Fabric for Reliable Services and Actors. This will be useful to…

Service Fabric Service Types

The model for Service Fabric allows for flexibility when it comes to designing the individual services, giving you the ability to pick the right programming model for each service. Deciphering the multiple options can be complex and really depends on each scenario and service you are building. Here I will try to break down the options how I see them. Please leave feedback if it was helpful or you…

Thoughts on Microsoft Build 2016

For the last few years there has been a major shift at Microsoft, one that has culminated in news from Build 2016 that I don’t think anyone saw coming… Bash on Windows The most exciting announcement for me to come out of Microsoft Build is that Bash Shell is coming to Windows 10 ! If you are just learning about this, stop everything and go learn how to install Bash on Ubuntu on Windows right now.…

Running Jekyll in Windows Using Docker

It has been just over a year since I wrote a post on running Jekyll in Windows using Vagrant . The world has relentlessly moved on… we now have Jekyll 3 and Docker has become popular to the point that you might want to check it out . So I revisited the way I was running my local version of my Jekyll blog. The previous way I outlined using Vargrant to run Jekyll on Windows has no issues but I…

Getting Started with Project Oxford Machine Learning APIs and Deployment on Azure

Project Oxford is cool. I am out at a lot of hackathons where I see students creating some amazing applications. While at the hackathons I see students struggling to get started with Project Oxford in their language of choice. Project Oxford is so powerful that I hate to see students struggle getting started so I created a series of videos and sample projects to get them started quickly. But…

How to install Elixir using Chocolatey on Windows

I got hooked on Elixir after reading Programming Elixir by Dave Thomas so I had to figure out how to install it on Windows. Turns out that installing Elixir on Windows is very easy using Chocolatey . If you haven’t heard of Chocolately before, it is the missing package manager for Windows (similar to apt-get or homebrew ). When combined with Boxstarter , it can be used to automatically set up your…

How to view, add, edit and remove files in Azure Web App using the Kudu service Dashboard

While debugging your Azure Web App deployments it is sometimes useful to view the files that are deployed to the service. Several situations come to mind. For example, trying to debug your database connection strings or possibly determining which files actually got deployed and where they sit in the file system . Or maybe you need to check if all your dependencies have been installed. Maybe a…

Softwrap: A Visual Studio Code Extension

NOTE: This extention is no longer needed. Visual Studio now supports word wrap. The defualt short cut is ALT -Z I use Visual Studio for most of my development work but I have always had a second editor that was smaller, lightweight and fast, to help accomplish those quick one off edits. A second editor always comes in handy when working on a configuration files, text files or maybe just peeking at…

Compiling ASP.NET 5 RC1 on a Mac or Linux

Update (12/18/2015): It is possible to compile ASP.NET 5 for the full .NET Framework on a Mac or Linux machine using Mono . More information can be found under the instructions for installing DNX for Mono on Mac. I didn't have Mono installed when I set up ASP.NET 5 and so ran into the errors below. It is very exciting times as the Release Candidate for ASP.NET 5 was released a couple weeks ago. Of…

Setting up PostgreSQL in Azure VM

Although you could still follow the instructions below to setup a PostgreSQL database manually you should checkout the fully managed Azure Database for PostgreSQL or find a PostgreSQL solution in the Azure Market Place . There are a few different ways to spin up an PostgreSQL database in Microsoft Azure . One of the easiest ways is via the MS Open Tech VM Depot . The VM Depot is a collection of…

Using Azure Table Storage with Bryan Soltis

In this interview I talk with Bryan Soltis from Kentico . Bryan is a Technical Evangelist for Kentico and has been working with Azure since it was in beta. In this video he talks about a tool developed internally to help manage Kentico’s Improvement Program, which is an optional program that gives anonymous feedback on features being used directly to Kentico. Bryan talks to us about why he chose…

Must have Visual Studio Extensions

There are alot of Visual Studio extensions out there and it has always surprised me at the number of Visual Studio users don’t know some of the must have extensions. Here is a list of my top 5 extensions that I must have installed and one bonus. Productivity Power Tools 2015 - This extension brings powerful tools for improved developer productivity. Once installed there is no configuration nessary…