Anthony Chu Contact Me

Running Service Fabric Guest Executables with Dynamic Ports

Tuesday, February 13, 2018

Service Fabric can dynamically assign ports to a service. For stateless and stateful services, the Service Fabric SDK makes it easy to configure our services to listen to the dynamically assigned ports. But what about guest executables, especially ones that are precompiled and we cannot or do not want to modify the source code?

We'll look at how to configure ports for two sample Windows guest applications without modifying the source code:

  • A Go application that takes a port number as a command line argument
  • A self-contained ASP.NET Core application that can be configured using the ASPNETCORE_URLS environment variable

Continue Reading...

Upload Files to Blob Storage during App Service (and Azure Functions) Deployment

Wednesday, February 7, 2018

A couple of months ago, AzCopy was quietly added to Windows App Service and Azure Functions worker instances at D:\devtools\AzCopy\AzCopy.exe. It is used to upload files to blob storage from the command line. App Service allows the running of arbitrary scripts during deployment, meaning that there are a couple of scenarios that are now possible by calling AzCopy during App Service Git deployment, including deployments with a "Deploy to Azure" button:

  • Upload files to blob storage for serving from a CDN during a Web App deployment
  • Upload a single page application (SPA) frontend to blob storage during an Azure Function App deployment

Today, we'll use Joe Raio's popular Azure Functions Tug of War demo app to show how to upload the app's frontend assets to blob storage during deployment.

Continue Reading...

Create a Hybrid Kubernetes Linux/Windows Cluster in 7 Easy Steps

Sunday, December 3, 2017

Azure Container Service (ACS) makes it really easy to provision a Kubernetes cluster in Azure. Today, we'll walk through the steps to set up a hybrid Kubernetes cluster with two agent pools: one for Linux and one for Windows. We'll also install an ingress controller and set it up with free and automatic SSL certificate management using Let's Encrypt. We should be able to do this in a few steps and under 20 minutes.

We'll then test out our cluster by deploying a hybrid application consisting of an ASP.NET application in a Windows container and a Redis instance in a Linux container.

Here's a simplified view of what we'll be deploying:

Continue Reading...

Deploying Windows Containers with Azure Container Instances (ACI) Connector for Kubernetes

Sunday, November 19, 2017

Update (January 2018) The ACI Connector has been replaced by the Virual Kubelet project. The functionalities are similar but the installation steps are slightly different.

Azure Container Instances (ACI) allows us to run containers without worrying about infrastructure. We can give it any container image and it'll happily run it; it'll even provision an external IP address for the container. It's "serverless containers": we're only charged when the containers run. It's great for batch workloads or long-running containers where we don't want to deal with infrastructure.

ACI provides a low-level infrastructure building block for running containers. We can sort of think of it like a VM; instead of running a VM image, it runs a container image.

One exciting example of how ACI can be used in combination with a container orchestrator is the experimental ACI Connector for Kubernetes. When installed in a Kubernetes cluster, the ACI Connector creates virtual nodes in the cluster. They behave like nodes with unlimited capacity. We can schedule pods to run on them, but they will actually be run as container groups on ACI.

Perhaps, one day, ACI Connector will be the foundation that enables "serverless Kubernetes"... imagine an Azure Container Service (AKS) Kubernetes cluster that has no physical nodes, and all work is scheduled on Azure Container Instances!

Recently, Windows container support was added to ACI Connector for Kubernetes. Today, we'll take a look at how to use it to run Windows containers.

AKS, ACI, ACI Connector

Continue Reading...

ASP.NET Web.config Transforms in Windows Containers - Revisited

Wednesday, November 15, 2017

When I last blogged about ASP.NET 4.x applications and web.config transformations in Windows containers, I was baking the transform files in the container images themselves. While this worked, the secrets were stored inside the container images. A much better approach is to supply the transformation at the time of container startup; we can do this by mounting a file when starting the container.

Continue Reading...