RSS Amplifier

Blog

Thorsten Hans

Recent content on Thorsten Hans

thorsten-hans.comRSS feed ↗252 posts

Latest posts

I’m Writing a Book on WebAssembly and Spin

Hey friends 👋🏼, If you’ve been following my activities over the recent years, you know I can’t stop talking about the third wave of cloud computing . Server-side WebAssembly is completely changing the game for cold-start latency and container bloat. Today, I’m thrilled to announce I’m turning those talks and architectural patterns into a practical, hands-on guide: Building…

Component Composition with Spin 4.0

Thanks to the WebAssembly Component Model we can stitch together multiple WebAssembly Components. Reusing Wasm Components boost developer velocity dramatically while language barriers vanish. In this hands-on article, I’ll explain how you can compose Wasm Components using Spin 4.0. What You Need To Follow Along I’ll try to keep things as simple as possible. That’s why we’ll…

Azure DevOps Extensions for Spin, Fermyon Wasm Functions and Fermyon Cloud

Do you want to build and deploy your Spin applications from within Azure DevOps pipelines? No matter if you want to target Fermyon Wasm Functions or Fermyon Cloud , the extensions I published to the Visual Studio Marketplace are here to help. Earlier today I published three distinct extensions for Azure DevOps allowing you to do all-the-things Spin, Fermyon Cloud and Fermyon Wasm Functions…

What I’ve Been Up To

Although this blog became a bit quite recently, I wrote a bunch of articles over on our corporate blog . I thought it’s worth sharing a comprehensive list of the posts I wrote: OpenAPI Documentation for Spin Apps with Rust In this guide, I’ll show you how to generate OpenAPI Specification (OAS) documentation directly from Spin apps written in Rust. You’ll learn how this improves API…

Uses

I tinker and update my setup very often. However, I try to keep this list as updated as possible. If you’ve further questions, send me a tweet @ThorstenHans . Hardware 2024 MacBook Pro 14" (M3 Max | 36 GB | 1 TB) as daily driver 2024 iPad Air 10" in Light Purple iPhone 15 Pro Max in graphite (256 GB) Apple Watch Ultra 2 AirPods Pro 3 + AirPods Max ZSA Voyager in black Logitech MX Master 3 2x…

Archive

All posts from my blog, organized chronologically.

WebAssembly and Containers with Docker Desktop - Hello World & Beyond

On top of being the runtime for containers, Docker Desktop is also able to run WebAssembly (Wasm) workloads. In this article, we’ll explore how one can run both containers and Wasm workloads together to build distributed architectures using the best of both worlds. Beta Feature: Wasm workloads in Docker Desktop is currently marked as a beta feature. What we are going to build Prerequisites…

Wasm ahead - Joining Fermyon

Hey everyone 👋🏼 A couple of weeks ago, I wrote about my farewell to Thinktecture . After sharing that news back in December, many readers, followers, and friends reached out to ask what my next chapter would be. It was really hard not to share the news right away, but I had to wait for the right time. I am more than excited to finally unveil that I will join Fermyon as a Cloud Advocate starting…

A Farewell to Thinktecture

Hello everyone 👋🏼, I wanna share some personal news with you today. After an incredible journey spanning almost nine years, I’ve decided to bid farewell to Thinktecture AG. My last day with the company will be at the end of January 2024. Reflecting on my time here, I am grateful for the experiences, challenges, and growth opportunities that have shaped me personally and professionally.…

A comprehensive guide on authoring plugins for Fermyon Spin

Did you know that you can extend the spin CLI with custom plugins that integrate seamlessly and feel like functionality provided by Fermyon itself? No? No problem! In this article, we will explore how I build the check-for-update plugin - a simple Spin plugin that allows you to check if your local installation of the spin CLI is outdated. On top of building the actual Spin Plugin, we’ll also…

Weekly Rust Trivia: How to use pattern matching

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to use pattern matching in Rust? In Rust, pattern matching is a powerful language feature that allows you to destructure data and match it against…

Weekly Rust Trivia: How to share state between threads

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to share state between threads in Rust? In Rust, we have the ability to share data between threads by using concurrent data structures and…

Weekly Rust Trivia: How to write a function-like macro

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to implement a function-like macro in Rust? Function-like macros in Rust are powerful tools that allow you to define macros that resemble function calls.…

Weekly Rust Trivia: How to write an HTTP API with Actix

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to implement the builder pattern in Rust? To create an HTTP API with Actix , we must add the actix-web crate to our project. We can add it using cargo…

Weekly Rust Trivia: How to Implement the Builder Pattern

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to implement the builder pattern in Rust? The derive_builder crate provides a macro which allows us to satisfy the builder pattern for your individual…

Weekly Rust Trivia: How to Implement a Generic Stack

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to implement a generic stack in Rust? To implement a generic stack, we can simply create a custom struct wrapping a vector ( Vec<T> ): struct Stack < T >…

Weekly Rust Trivia: How to Retrieve Image Dimensions

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to retrieve the dimensions of an image in Rust? The image crate provides necessary functionality to work with images in Rust. We can combine…

Weekly Rust Trivia: How to create a TCP Server

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to create a TCP server in Rust? We can use the io and net and thread modules from Rust standard library this trivia. use std :: io :: { Read , Write };…

Weekly Rust Trivia: How to Implement Binary Search

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to implement binary search in Rust? All we need to implement binary search in Rust is bringing the cmp module into scope. The cmp::Ordering enum and the…

Weekly Rust Trivia: How to Read a CSV File

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to read a .csv file in Rust? The csv crate provides necessary functionality to work with .csv files in Rust. We can combine functionality provided by the…

How to use Azure Cosmos DB as a key-value store for Fermyon Spin

With the 1.2.1 release of Fermyon Spin, we can now use Azure Cosmos DB as a key-value store for persisting data when building serverless applications. In this article, I guide you through setting up the necessary infrastructure and creating a fairly simple app to store and retrieve arbitrary values using Azure Cosmos DB as the key-value store. All code shown in this article is also available on…

Weekly Rust Trivia: How to Compute a SHA256 Hash of a File

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to compute a SHA256 hash of a file in Rust? The sha2 crate is an implementation of cryptographic hash algorithms that we can use to compute hashes. We…

Weekly Rust Trivia: How to Download an Image to a File

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to download an image from the web and store it in a file using Rust? The reqwest crate allows us to create HTTP requests with ease, we can combine…

Weekly Rust Trivia: How to Get all Files in a Directory

Weekly Rust Trivia is a problem-oriented series of articles that assist developers while learning Rust. Every article solves simple, everyday development tasks using the Rust standard library or leveraging popular and proven crates. Question: How to get a vector ( Vec<String> ) containing all filenames of a particular directory in Rust? We can use the fs and io modules from Rust standard library…

How I replaced the backend of my blog with Spin & Fermyon Cloud

Although my blog is built using Hugo - a famous Static Site Generator - I&rsquo;ve some functionality baked into the page that requires having a backend (basically an HTTP API). Historically, the backend was hosted in Azure leveraging Azure Container Apps. Recently, I replaced the entire backend for my blog using a Fermyon Spin application hosted in the fully managed Fermyon Cloud . In this…

A First Glance at the Spin Router for Rust

With the release of Fermyon Spin 1.1 (April 15th, 2023), the Spin SDKs for Rust and Go now provide a built-in router for HTTP applications. In this post, we will take a quick look at the built-in router supplied by the Spin SDK for Rust and build a small sample application to illustrate how one could solve day-to-day requirements when building serverless applications with WebAssembly (Wasm).…

Let&#39;s build a HTTP router for Spin with Rust

Although we can build more complex HTTP applications in Fermyon Spin by composing multiple components, having a single component is easier, reduces development time, and is more flexible in the first place. In this article, I will explain how to implement simple routing capabilities using enumerations in Rust. Note: 💡 Spin 1.1 brings Built-in Router for Rust & Go Shortly after publishing this…

Let Spin lift your key-value store

For quite sometime now (since version 0.9.0), Spin has had built-in key-value support. In this article, we will quickly investigate how we can use that built-in key-value support when building serverless applications with Fermyon Spin. What are key-value stores Why should you use key-value stores in serverless apps Key-value stores in Spin Let&rsquo;s build a simple URL shortener using the Spin…

CRUD in WebAssembly with Fermyon Spin and MySQL

With the latest release of Fermyon Spin (v 0.7.0), we can persist data in MySQL (persistence in PostgreSQL has been available for quite some time now). Being able to persist and retrieve some sort of data is a must-have for any kind of application. In this article, we’ll take a look at a full-fledged CRUD implementation. We’ll build an HTTP-API that allows its users to C reate, R ead, U pdate, and…

Master configuration data in Fermyon Spin

Every application has to deal with configuration data, and applications built using Fermyon Spin are no exception here. Instead of baking configuration data into your source code, you should attach it from the outside to alter behavior of your applications without having to re-compile your source code. This short article demonstrates how to deal with configuration data when building applications…

Azure Blob Storage using the Azure SDK for Go

The Azure SDK team reworked the SDK for Go and released a bunch of Go modules to interact with popular cloud services - not just from a management perspective. In this post, we will take a closer look at the Go-modules for interacting with blob storage capabilities offered by Azure Storage Account. When interacting with Azure services, we must authenticate. The Azure SDK for Go supports different…

Building Microservices With WebAssembly and Fermyon Spin

Although WebAssembly is an excellent fit for bringing complex solutions that need near-native runtime performance to the client (Browser), I see WebAssembly as a technology with way more potential and a way bigger impact on the server (read: cloud) in contrast. That said, WebAssembly will not replace containers on the server side. It’s an addition or alternative approach to packaging and…

Hot-Reload .NET Configuration in Kubernetes with ConfigMaps

Leveraging ConfigMaps, we can inject configuration data into applications running in Kubernetes. In this article, we’ll look at how to use a Kubernetes ConfigMap to configure a .NET application from the outside and automatically reload changes applied to the ConfigMap. Automatically reloading configuration data without redeploying the application and without doing a code change is super handy -…

Instrumenting .NET Apps with OpenTelemetry

Instrumenting applications is critical to address observability in cloud-native. Receiving detailed traces, metrics, and logs in distributed application architectures is mission-critical regarding monitoring and troubleshooting. This article will look at OpenTelemetry and instrument a .NET application to ensure our overall application becomes observable at runtime. What is OpenTelemetry The sample…

Background Workers in Azure Container Apps with KEDA

Azure Container Apps has quickly evolved and become one of the most popular platforms to run containerized workloads in Azure. This article will look at how to run Background Workers in Azure Container Apps leveraging built-in KEDA. Developers can use Azure Container Apps to run simple cloud-native applications leveraging popular underlying technologies like Kubernetes, Dapr, and KEDA. Before we…

How to build multi-arch Docker Images with ease

With the rise of ARM-based cloud computing resources and Apple&rsquo;s switch from Intel-based CPUs to Apple Silicon, building Docker Images for multiple architectures has become increasingly important. We, as developers, must ensure that our applications can be executed on every potential architecture. We can easily achieve that by using Docker CLI and the buildx plugin. This article will look at…

Provision AKS and NAT Gateway with Terraform

A Virtual Network NAT (NAT Gateway) is the recommended method for outbound connectivity when using Azure Virtual Networks (vNets). We can also use a NAT Gateway to route egress traffic from Azure Kubernetes Service (AKS), if the AKS cluster is deployed to a subnet associated with a NAT Gateway. In this article, we&rsquo;ll look at what NAT Gateway is, which benefits you get from using a NAT…

Patch Kubernetes objects with .NET: The Simple Way

By leveraging the official Kubernetes client libraries for C#, we can easily interact with any Kubernetes cluster. We can also update (or patch) existing objects by invoking the corresponding Patch* methods (like PatchNamespacedPod , PatchNamespacedConfigMap , and many more) provided by the client library. Although we can construct patches from different formats ( JsonPatch , ApplyPatch ,…

How to Deploy Azure Container Apps with Terraform

Although we can provision and manage Azure Container Apps with Project Bicep ( as explained in this article ), people keep on asking how to manage their Azure Container Apps using HashiCorp Terraform. This article demonstrates how to provision Azure Container Apps with Terraform utilizing a combination of the well-known AzureRM provider ( azurerm ) and the recently released AzAPI provider ( azapi…

Let&#39;s build a gRPC server and client in Rust with tonic

Last week I was showcasing WebAssembly in the cloud using krustlet and Fermyon Spin at Cloudland 2022 in Brühl (Germany). While preparing for the talk, I recognized how much I&rsquo;d missed Rust 🦀 over the past months. Although I&rsquo;ve been reading articles and watching some videos on Rust in general from time to time, I missed doing some hands-on. So I dedicated some time to do a quick…

Awarded as a Docker Captain and as a Microsoft MVP

Although we took ten days off and went to Egypt for vacation, the weeks were quite packed. Besides the entire family enjoying the stunning weather in Egypt, two things happened that I wanted to share with you. First, I am humbled and honored to share that I got awarded as a Docker Captain in June 2022 . Docker Captain 2022 Joining an exclusive community of well-known, individual Docker experts…

Docker SBOM - or how to dive into shift-left security

Recently, Docker added a new command to Docker CLI. docker sbom . We can use this command to create a Software Bill of Materials (SBOM) for any container image. Another great capability when it comes to shift-left security. This post explains why you should want to have SBOMs for all the container images of your application. How to get them and which actions you can take based on SBOMs to improve…

az containerapp up - AKA amazing inner-loop performance

The Azure Container App team released a new command to simplify the deployment process. With az containerapp up , you can deploy your workload to Azure Container Apps (ACA) with one command. This article demonstrates how to use az containerapp up and how you can tailor its behavior to meet your requirements. What does az containerapp up actually do? Install the containerapp extension for Azure CLI…

How to lint Docker images with Dockle

We&rsquo;ve been building container images for quite some time (read almost decades) now. Although tooling, editor, and IDE support have matured, we should not forget about hardening container images in the inner loop. This post demonstrates how to use Dockle to lint your container images according to security best practices. Why should we lint container images We&rsquo;ve to talk about the „ why…

Check if your application is running in a Docker container

Especially when building cloud-native applications, we tend to develop applications that run in any environment. We design components, so we can run them with or without container technologies to ensure we can host the application on different application platforms. However, sometimes we may have to determine if our applications are running inside a Docker container or not. This allows us to take…

Managed Identities With Azure Container Apps

Yesterday (13th of April 2022), we saw a couple of new features appearing in Azure Container Apps (ACA). This article will use managed identities with Azure Container Apps, which allows us to authenticate and rely on Role-Based Access Control (RBAC) when interacting with other Azure services. Before we dive into using managed identities in Azure Container Apps, let&rsquo;s do a quick refresher…

Speaker Bio

English Speaker Bio Thorsten Hans is a Senior Developer Advocate at Akamai, Docker Captain, and Wasm enthusiast. He thrives on pushing the limits of WebAssembly and Edge Computing to help developers build high-performance distributed systems. Thorsten shares his technical deep-dives via his blog and on global stages to shape the cloud’s future. German Speaker Bio Thorsten Hans ist Senior Dev…

Logging in Kubernetes with Loki and the PLG stack

Observability is a huge topic in cloud-native environments. One must collect, understand, and investigate millions of logs from different sources to understand what&rsquo;s happening at an application&rsquo;s runtime. Log stacks - like PLG - address all those concerns and are typically composed of multiple applications with dedicated responsibilities. At the core of every log stack, a log…

Let&#39;s build a CLI in Go with Cobra

Cobra is perhaps the most popular Go-module to build powerful command-line applications (CLIs) in almost no time. This article will look at what Cobra is, its core concepts, and which features it brings to the table for building CLI applications. https://github.com/spf13/cobra Through this article, we will build stringer , a fairly simple CLI application. stringer allows its users to reverse and…

Custom health probes with Azure Container Apps

In Kubernetes, individual probes like liveness , readiness , and startup are mission-critical when deploying applications. Kubernetes uses probes to determine the health of containers in a Pod . Kubernetes may restart Pods because of failing probes. On top of that, Kubernetes uses probes to determine if a particular container can deal with incoming requests. Kubernetes Services will route incoming…