Anthony Chu Contact Me

Hosting a Blazor App in Azure Storage Static Websites

Thursday, June 28, 2018

In recent years, there's been a shift towards building applications with serverless architectures. Serverless backends are typically powered by fully managed and infinitely scalable services with consumption-based pricing, such as Azure Functions and Logic Apps.

Today, Azure Storage announced the public preview of its static website hosting feature that complements serverless backends by making it easy to also host frontend single page applications (SPAs) in a fully managed, highly scalable, consumption-based service. Blob Storage has always been able to serve static assets such as HTML, CSS, and JavaScript. The static websites feature adds more traditional web server capabilities that are required to host SPAs and statically generated websites, including support for defining default and error pages.

Blazor is an experimental framework from the ASP.NET team for building SPAs using .NET instead of JavaScript. It does this by running standard .NET DLLs in the browser on top of a Mono runtime that has been compiled to WebAssembly.

In this post, we'll look at how to host a standalone Blazor application with no server-side code in a Azure Blob Storage static website.

Continue Reading...


Using VSTS to Deploy to Azure Functions and App Service with Run-From-Zip

Thursday, February 15, 2018

Update May 14, 2018 - The app setting WEBSITE_USE_ZIP is now WEBSITE_RUN_FROM_ZIP. This article as been updated to reflect this.

Yesterday, Azure announced a new way to deploy our applications to Azure Functions and App Service called Run-From-Zip, currently in preview. It allows us to mount the contents of a zip file into wwwroot instead of copying files into that folder.

In this article we'll take a look at how to use Visual Studio Team Services (VSTS) to build and deploy an application to Azure Functions and Azure Web Apps.

Continue Reading...


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...