Edi Wang

.NET and Azure Developer

.NET C# Programming Language and .NET Platform

Json Serialization Caveat in Azure Function

Creating Azure Functions using C# and .NET can feel quite familiar to those versed in creating ASP.NET Core Web APIs. Despite the similarities, one key difference lies in the process of JSON serialization, which can present unexpected challenges. In this post, I'll explore the two most common issues developers encounter with JSON in Azure Functions and provide practical solutions to overcome them. …
.NET Json Azure

How to Detect If Your Application is Running in Azure App Service

An application needs to know if itself is running in Azure App Service, so that it can apply special logic and optimization for Azure. When deploying an application to Azure App Service, the platform automatically assigns a set of environment variables that can be accessed by the application code. In this post, we will see how can our application get this information. …
.NET Azure App Service

Call API with Windows Authentication from Blazor Web Assembly

I was rewriting an old Angular application to Blazor Web Assembly a couple of days ago. The App is an internal tool, which uses a backend API that has Windows Authentication. However, when calling API from HttpClient that UseDefaultCredentials, Blazor will throw PlatformNotSupportedException. The majority of internet search so far tell you it's not possible. Really? Let's see how to make it work! …
.NET Web API Blazor

Cloud Architecture Design of My Email Notification Infrastructure on Azure

My blog system "Moonglade" needs to send email notifications to blog owner when there are events like new comments, new pingbacks, and send email to readers when their comments are replied.  I've been building my own infrastructure in the last few years. I will share the journey of how this email infrastructure evolved and the things I learnt. …
ASP.NET Azure Azure Function Azure Storage Queue

Get Client IP When Your ASP.NET Core App is behind Reversed Proxy on Azure App Service

Problem I have a web app with a web front end and API backend both deployed to Azure App Service. I reversed proxy the API using this method I described before, so that my web front end can access API without having CORS issue, and the end users won't need to access my API address directly. However, for the API code, the client IP address I got is always Azure app service's outbound IP instead …
.NET Azure App Service

Move CRON Expression from Hard Code to Configuration in Azure Function App

When creating Azure Function with Timer trigger, we usually write CRON expression in our function code. But when you need to dynamically adjust your timer based on business needs, you will have to update your code and redeploy the function. Let's see how we can remove the hard code CRON expression and put it into configuration that we can easily update on the Azure Portal without redeploy the code …
Azure Azure Function

System Fonts on Azure App Service for Linux

In early this year, I am upgrading my Captcha library, the code that renders text on images blow up when running under Azure App Service for Linux. I can tell from the error message that the font I am using is not installed on Azure App Service's hosting machine. To fix this, I need to find out what fonts are there in Azure App Service for Linux. Let's see how to do it. …
Azure Linux