<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Edi Wang</title><description>Microsoft MVP for Azure</description><link>https://edi.wang/</link><pubDate>2026-04-18T22:38:59Z</pubDate><copyright>© 2009 - 2026 edi.wang</copyright><generator>Moonglade v15.13.2</generator><language>en-US</language><item><title>Hot Reloading a File in Azure Container Apps with Zero Down Time</title><link>https://edi.wang/post/2026/3/3/hot-reloading-a-file-in-azure-container-apps-with-zero-down-time</link><description>Recently, I developed an ASP.NET Core application that can query a local data file for IP address information. The application is deployed to Azure Container Apps, and the data file is mounted in Azure File Share as a volume for the container. There is another job that will update the data file every day on schedule. The application would not read the entire data file on each request for performance concerns, it would load the data into memory on start up. The blog post will explain how to reload the data on the fly without downtime.</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">9C2D6CA5-03C9-4522-AC56-9D19F601803F</guid><pubDate>2026-03-03T09:37:30Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2026-03-03T09:37:30Z</updated></item><item><title>Migrating this Blog to Docker on Linux with Azure App Service</title><link>https://edi.wang/post/2026/2/5/migrating-this-blog-to-docker-on-linux-with-azure-app-service</link><description>This blog runs on my open-source project Moonglade, a blogging platform built with ASP.NET Core and hosted on Azure. Recently, I migrated it from a Windows Server environment to Docker on Linux, still running on Azure App Service. It’s been running smoothly in production for about two months now. In this post, I’ll walk through that migration journey: what I changed, a few tips and tricks along the way, and some lessons learned that might help you if you’re considering a similar move.</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">EE9EE084-E170-4A5B-BFA5-16772F7AEC53</guid><pubDate>2026-02-05T05:09:58Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2026-02-05T05:09:58Z</updated></item><item><title>程序员的情绪价值：用 C# 构建实时 MIDI 播放器</title><link>https://edi.wang/post/2025/9/25/build-a-c-sharp-midi-player</link><description>在数字音乐的世界里，MIDI（Musical Instrument Digital Interface）就像是音乐的"基因密码"。作为直男程序员，我最近使用.NET 9.0 C# 写了一个命令行 MIDI 播放器，用来增加自己的情绪价值。本文将分析这个有趣的开源项目 Edi.MIDIPlayer，它不仅能播放MIDI音乐，还能实时显示每一个音符的"生命轨迹"。</description><category>.NET</category><guid isPermaLink="false">23BDB83D-04C1-4CB4-ACC8-384C59FFDB70</guid><pubDate>2025-09-25T13:27:34Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2025-09-25T13:27:34Z</updated></item><item><title>凑发票算法：经典背包问题的变种</title><link>https://edi.wang/post/2025/2/8/invoice-algorithm-variant-of-the-backpack-problem</link><description>在日常工作中，特别是报销或财务处理时，经常会遇到这样的问题：如何从一堆发票中找到金额满足某个值的最优组合？假设我们有一组发票，每张发票以文件名的形式存储，文件名包含发票金额，例如 酒店-996.35.pdf 打车-251.00 医疗-404.00 。我们的目标是从这些发票中，找到金额总和 至少等于目标金额 的最优组合，并且总金额尽可能接近目标金额。要解决这个问题，我们可以将其看作一个 背包问题的变种，即在给定一组发票的情况下，找到满足条件的金额组合。本文的算法采用 回溯法 来实现，逐步尝试每种可能的组合，并记录满足条件的最佳结果。</description><category>.NET</category><guid isPermaLink="false">394EB470-0F6E-45FE-8416-0E346F3C4FDF</guid><pubDate>2025-02-08T01:59:22Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2025-02-08T01:59:22Z</updated></item><item><title>Understanding the "Efficient Shipping" Interview Question in C#</title><link>https://edi.wang/post/2025/1/28/understanding-the-efficient-shipping-interview-question-in-c-sharp</link><description>When preparing for interviews, you'll often come across optimization problems that test both your problem-solving skills and your ability to write efficient code. I have such an interesting programming interview question years ago. The Efficient Shipping problem. Let's break it down and analyze the solution. And to understand the flaws in the first version of my code and how we can improve it.</description><category>.NET</category><guid isPermaLink="false">ED0E743D-A374-46A2-B334-830B36F3DA64</guid><pubDate>2025-01-28T01:22:47Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2025-01-28T01:22:47Z</updated></item><item><title>Migrating Moonglade.Email to Azure Communication Service</title><link>https://edi.wang/post/2024/11/25/migrating-moongladeemail-to-azure-communication-service</link><description>Moonglade.Email, is an Azure Function that originally relied on SMTP for sending emails. Microsoft implemented a change that prevents connections to both personal and enterprise Office 365 Outlook mailboxes. To ensure the email service continues functioning, I decided to integrate Azure Communication Services. In this blog post, I will explain how I implemented support for Azure Communication Services in the Moonglade.Email Azure Function.</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">B3B44BF5-0D2C-48AC-A615-309385690F28</guid><pubDate>2024-11-25T02:58:17Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2024-11-25T02:58:17Z</updated></item><item><title>Upload Files to Azure Blob Storage without Azure SDK</title><link>https://edi.wang/post/2024/9/2/upload-files-to-azure-blob-storage-without-azure-sdk</link><description>Typically, we use the Azure SDK to upload files to Azure Blob Storage, as it is the easiest method supported by Microsoft. However, there are situations where the Azure SDK might not be available. So, how can we still upload files to Azure Blob Storage in such cases? In this post, I will guide you through the steps to upload files to your Azure Storage Account without using the Azure SDK.</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">216857F2-8B2C-4FFA-BE43-3D5C501221E5</guid><pubDate>2024-09-02T01:38:36Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2024-09-02T01:38:36Z</updated></item><item><title>Solving NuGet Package Target Naming Conflict</title><link>https://edi.wang/post/2024/8/15/solving-nuget-package-target-naming-conflict</link><description>In my ASP.NET Core project, I encountered an issue where files from the tinymce NuGet package were not being copied to the wwwroot\lib directory during the build process, despite referencing both tinymce and Moonglade.MonacoEditor packages. Each package included a .targets file with a Target named CopyScriptsToProject, resulting in a conflict where the latter target overwrote the former, causing only Moonglade.MonacoEditor files to be copied. To resolve this, I renamed the targets in each .targets file to ensure uniqueness.</description><category>.NET</category><guid isPermaLink="false">D08CC05E-FA1F-4621-BFE0-7B12BE3BDAFD</guid><pubDate>2024-08-15T00:59:33Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2024-08-15T00:59:33Z</updated></item><item><title>How to Add JsonStringEnumConverter in Azure Function Isolated Worker</title><link>https://edi.wang/post/2024/4/8/how-to-add-jsonstringenumconverter-in-azure-function-isolated-worker</link><description>Azure Function Isolated worker for .NET replaced its default Json Serializer from Newtonsoft.Json with System.Text.Json. This change caused certain behavior differences. In my case, I am not able to deserialize an Enum type from a string value. Let's see how to use JsonStringEnumConverter to fix it! …</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">17AF1693-3A22-4776-AE79-E70DAE76B485</guid><pubDate>2024-04-08T01:02:26Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2024-04-08T01:02:26Z</updated></item><item><title>Json Serialization Caveat in Azure Function</title><link>https://edi.wang/post/2024/2/7/json-serialization-caveat-in-azure-function</link><description>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. …</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">18FA315A-0E55-426E-9466-59DB706836BC</guid><pubDate>2024-02-07T08:35:05Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2024-02-07T08:35:05Z</updated></item><item><title>How to Detect If Your Application is Running in Azure App Service</title><link>https://edi.wang/post/2023/12/14/how-to-detect-if-your-application-is-running-in-azure-app-service</link><description>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. …</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">34230828-8408-4830-8972-C9DD22F8EEC7</guid><pubDate>2023-12-14T08:34:41Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2023-12-14T08:34:41Z</updated></item><item><title>Call API with Windows Authentication from Blazor Web Assembly</title><link>https://edi.wang/post/2023/10/20/call-api-with-windows-authentication-from-blazor-web-assembly</link><description>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! …</description><category>Web Development</category><category>.NET</category><guid isPermaLink="false">9C4D64CA-5B5B-432E-8AE5-4C06125658BE</guid><pubDate>2023-10-20T07:17:07Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2023-10-20T07:17:07Z</updated></item><item><title>How Azure App Service for Linux Runs Your .NET Application</title><link>https://edi.wang/post/2023/9/1/how-azure-app-service-for-linux-runs-your-net-application</link><description>Azure App Service started to support Linux in 2017 as well as containers. It has similar capability as classic App Service on Windows Server, which can run .NET, Java, NodeJs, PHP and Ruby applications with CI/CD and auto scale. In this post, I will use ASP.NET Core application as an example to explore its underlying mechanism to see how it works. …</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">C94932AD-7FBA-4E49-9150-FAD157F216EA</guid><pubDate>2023-09-01T00:53:09Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2023-09-01T00:53:09Z</updated></item><item><title>Cloud Architecture Design of My Email Notification Infrastructure on Azure</title><link>https://edi.wang/post/2023/2/21/cloud-architecture-design-of-my-email-notification-infrastructure-on-azure</link><description>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. …</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">4ABA1052-2C5C-4A23-A942-340A36DAD46C</guid><pubDate>2023-02-21T01:47:36Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2023-02-21T01:47:36Z</updated></item><item><title>Get Client IP When Your ASP.NET Core App is behind Reversed Proxy on Azure App Service</title><link>https://edi.wang/post/2022/12/9/get-client-ip-when-your-aspnet-core-app-is-behind-reversed-proxy-on-azure-app-service</link><description>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 …</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">7DB42E5B-275B-4A84-86A3-2DAFA48F3730</guid><pubDate>2022-12-09T07:54:03Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2022-12-09T07:54:03Z</updated></item><item><title>Move CRON Expression from Hard Code to Configuration in Azure Function App</title><link>https://edi.wang/post/2022/9/13/move-cron-expression-from-hard-code-to-configuration-in-azure-function-app</link><description>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 …</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">EE163CFF-25CC-43EA-8393-DCD7044A352E</guid><pubDate>2022-09-13T07:24:59Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2022-09-13T07:24:59Z</updated></item><item><title>System Fonts on Azure App Service for Linux</title><link>https://edi.wang/post/2022/9/4/system-fonts-on-azure-app-service-for-linux</link><description>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. …</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">DC34A11C-5BD7-4535-A8B3-F2B873C09A83</guid><pubDate>2022-09-04T22:47:06Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2022-09-04T22:47:06Z</updated></item><item><title>Fix Encoding.Default.GetChars() Result Different in .NET Framework and .NET 6</title><link>https://edi.wang/post/2022/9/2/encoding-default-diff-netfx-net6</link><description>When upgrading a legacy .NET Framework application to .NET 6, a custom encryption method that uses Encoding.Default.GetChars() method, which output wrong result. Let's see why and how can we fix it. …</description><category>.NET</category><guid isPermaLink="false">929531BD-B9E1-401A-A5B5-1325D8131D9E</guid><pubDate>2022-09-02T02:19:33Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2022-09-02T02:19:33Z</updated></item><item><title>Adding Azure Cache for Redis in My Elf Project</title><link>https://edi.wang/post/2022/2/18/adding-azure-cache-for-redis-in-my-elf-project</link><description>ASP.NET Core Memory cache has its own limits. It is difficult to scale in a cloud environment with multiple instances. Azure Cache for Redis provides a fully managed distributed cache service for cloud applications. It is built on top of Redis, a popular cache and messaging product. Integrating Redis into cloud applications can improve performance and scalability. …</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">BC8289F9-0666-475F-AB0F-2FD237E8B21D</guid><pubDate>2022-02-18T02:17:14Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2022-02-18T02:17:14Z</updated></item><item><title>How to Get Access Token for Azure REST APIs in .NET</title><link>https://edi.wang/post/2021/8/23/how-to-get-access-token-for-azure-rest-apis-in-net</link><description>I am recently working on a project that requires front-end to call Azure REST APIs. Microsoft document describes how to get Access Token in postman via Jon Gallant's blog post. However, placing secret keys in front-end is very dangerous. In my project, I must get the Access Token from server side in .NET. Let's see how to do it. …</description><category>.NET</category><category>Microsoft Azure</category><guid isPermaLink="false">9263C768-28D9-4ED6-9DE9-F184C25A0228</guid><pubDate>2021-08-23T05:49:07Z</pubDate><updated xmlns="http://www.w3.org/2005/Atom">2021-08-23T05:49:07Z</updated></item></channel></rss>