Anthony Chu Contact Me

Experiment with New Languages and Frameworks with VS Code Remote Development in Containers

Monday, July 8, 2019

In April, Visual Studio Code launched their new Remote Development extensions. With VS Code Remote Development, a VS Code instance on our local machine can access and use a container, remote machine, or Windows Subsystem for Linux (WSL) as a full-featured development environment.

I've been using all three flavors of VS Code Remote Development and they each unlock some really exciting scenarios. Today, we'll look at how VS Code Remote with containers allows us to experiment with new languages and frameworks without installing any new tools or SDKs on our machines.

The specific scenario we'll look at is to use a container to test out the latest nightly build of ASP.NET Core 3.0 (currently Preview 7).

Continue Reading...


Event-Driven Serverless Containers with PowerShell Azure Functions and Azure Container Instances

Monday, April 29, 2019

Today, the Azure Functions team announced the public preview of their V2 runtime's support for PowerShell (PowerShell was previously in V1 as an experimental language).

In Azure Functions V2, PowerShell isn't just another language for writing serverless apps; it opens the door for many event-driven automation scenarios that weren't easily achieved with Azure Functions before. It uses a brand new PowerShell Core language worker built by the PowerShell team.

Using managed identities, a PowerShell Azure Function app can automatically log into a system-managed Azure Active Directory identity. When combined with the Azure PowerShell module, we can write Azure Functions that can securely manage any resource in Azure.

In this article, we'll look at how we can trigger and monitor batch jobs using PowerShell Azure Functions and Azure Container Instances.

Continue Reading...


Real-time Speech-to-Text and Translation with Cognitive Services, Azure Functions, and SignalR Service

Tuesday, March 26, 2019


When we do a live presentation — whether online or in person — there are often folks in the audience who are not comfortable with the language we're speaking or they have difficulty hearing us. Microsoft created Presentation Translator to solve this problem in PowerPoint by sending real-time translated captions to audience members' devices.

In this article, we'll look at how (with not too many lines of code) we can build a similar app that runs in the browser. It will transcribe and translate speech using the browser's microphone and broadcast the results to other browsers in real-time. And because we are using serverless and fully managed services, it can scale to support thousands of audience members. Best of all, these services all have generous free tiers so we can get started without paying for anything!

Overview

The app consists of two projects:

  • A Vue.js app that is our main interface. It uses the Microsoft Azure Cognitive Services Speech SDK to listen to the device's microphone and perform real-time speech-to-text and translations.
  • An Azure Function app providing serverless HTTP APIs that the user interface will call to broadcast translated captions to connected devices using Azure SignalR Service.

Architecture

Continue Reading...


Build Real-time Serverless Java Apps with Azure SignalR Service

Wednesday, March 6, 2019

Today, Microsoft announced the general availability of the Azure SignalR Service bindings for Azure Functions. The bindings allow Azure Functions to integrate seamlessly with SignalR Service to broadcast real-time messages at large scale over WebSockets.

We'll take a look at how to build a browser-based, collaborative drawing app using HTML and JavaScript. Multiple people can open the app in their own browser and draw on the canvas. Changes are synchronized in real-time using Azure Functions and SignalR Service.

Java language support in Azure Functions has also recently become generally available. We'll be writing our functions in Java, but the SignalR Service bindings also work with other languages supported by Azure Functions.

Overview

There are three major components of the app: the drawing canvas, the Azure Function app, and Azure SignalR Service.

Architecture

Continue Reading...


Broadcast Real-time Updates from Cosmos DB with SignalR Service and Azure Functions

Monday, September 24, 2018

Azure Cosmos DB has a nifty change feed feature that tracks create and update events on documents in a collection. Applications, including serverless apps built with Azure Functions, can read events from the change feed and listen to new events on the change feed in real-time.

Azure SignalR Service is a managed service that allows applications to broadcast real-time messages to many connected clients over WebSockets and other supported transports.

September 24, 2018 - Azure SignalR Service is now generally available!

March 6, 2019 - SignalR Service bindings for Azure Functions are now generally available!

In this article, we'll look at how we can use Azure Functions and SignalR Service to broadcast real-time document changes in Cosmos DB to clients over WebSockets.

Overview

Here's how all the pieces fit together.

  1. A document is created or updated in Cosmos DB.
  2. The change or update event is automatically logged in the Cosmos DB change feed.
  3. Using the Cosmos DB trigger, an Azure Function is invoked when the event appears in the change feed.
  4. Using the SignalR Service output binding, the function outputs a message to SignalR Service.
  5. SignalR Service sends the message to all connected clients over WebSockets.

The SignalR client SDK is available in JavaScript and .NET Standard. There's also a Java client coming soon. We'll use a simple Vue.js app in a browser for this project. Using the .NET Standard SDK, we can also build desktop apps with .NET Framework and .NET Core or mobile apps with Xamarin to receive messages from SignalR Service.

Continue Reading...