Edi Wang

Microsoft MVP for Azure

.NET C# Programming Language and .NET Platform

Upload Files to Azure Blob Storage without Azure SDK

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.
Azure Azure Blob Storage

Solving NuGet Package Target Naming Conflict

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

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