Edi Wang

.NET and Azure Developer

All Posts

Docker Support for My .NET Core Blog System on Azure

"Moonglade", the open-source blog system used by my blog (https://edi.wang), has been around for over a year. At least four community friends have used the system to deploy their own blogs on Azure and Alibaba Cloud. Unfortunately, the system has long lacked Docker support, which is the political correctness of today's world. Recently things have changed, and I successfully made my blog system run …
Azure Linux Docker

How to Check Resource Existence in Azure CLI

Azure CLI can help us automate the configuration and management tasks of Azure. Ideally, for repetitive tasks, using CLI scripts can help us save time. However, Azure CLI still has some features that are not convenient enough, such as checking the existence of resources. Current Situation For some resource types, such as Resource Group, Azure CLI provides exists directive that can return the …
Azure CLI

How to Check If .NET Core Program is Running under Remote Desktop

There are a few reasons that we need to know if our program is running under the Windows Remote Desktop (RDP) session. For example, if it is running under RDP, we may disable animation and other fancy graphics effects. But how can we detect if our program is currently under RDP? Let's see. Windows Forms If you are developing Windows Forms Apps using .NET Core 3.x, there's a built-in API that can …
.NET Windows Remote Desktop

Performance Optimization for My .NET Core Blog on Azure

I rewrote my blog system with .NET Core last year. After more than a year of optimization, the server response time is now 8ms comparing to 80ms when it first went live. This article shares what I have done to make my blog works really fast. In fact, before .NET Core, my old blog system was written by .NET Framework, built from ASP.NET Web Form 2.0 in 2008 all the way up to ASP.NET MVC5 in 2018. …
.NET Azure CDN

2019 年终回顾:不忘初心,负重前行

2019 年就要接近尾声,这一年对于我来说,有许多有意义的事件。我成长了许多,并依然保持着对技术的热情。在辞旧迎新之际,我想回顾一下我这一年中有意义的事件与收获,期待与大家一起在2020年继续成就不凡! 微软 MVP 全球峰会 今年3月,我有幸参加了在美国雷德蒙微软总部举办的MVP全球峰会,这是我第二次去美国,第一次去西雅图。我从小就崇拜比尔·盖茨先生及他创办的伟大的微软公司,而去微软总部参观,可以说是“朝圣”,我儿时的梦想之一终于实现,这次MVP全球峰会总算是拔了颗0x14年的草了。 (图:呼吸着微软总部的空气) 微软总部的园区非常大,需要乘坐 shuttle bus 穿梭于各个大楼之间。我们的会场在 Building 33,即 Microsoft Conference Center。4天的大会日程非常充实,可以了解到还未发布的新功能,也可以大量汲取其他MVP分享自己的技术精髓。 会 …
Azure Microsoft MVP

How to Allow Only Selected Users to Access an Application in Azure AD

My blog supports Azure AD authentication. I created the Azure AD application inside Visual Studio, by default, all users under my Azure AD will have access to my blog's admin portal. This is not ideal for an enterprise application that needs to limit access for only a few selected users or groups. Let's see how to configure an Application in Azure AD to enable access for just a few users. Make …
Azure Azure AD

Upgrade WinForms Apps from .NET Core 3.0 to 3.1

I upgraded a WinForms App to .NET Core 3.1 these days. It's an open-source on-screen ruler created by Jeff Key in 2004, the original code was for .NET Framework 2.0, I've already upgraded it to .NET Core 3.0 in September this year, it was very smooth without any code change. But this time, .NET Core 3.1 does require some code changes.  The project is on my GitHub: https://github.com/EdiWang/ …
.NET WinForm

Try the New Azure .NET SDK

Recently, Microsoft unveiled a new Azure .NET SDK, it's not a simple version upgrade, but a major change in the programming experience. While it may take a while to adapt to the new SDK, it is worth learning. The new SDK is more powerful, more flexible and easier to use. Current Status of Azure .NET SDKs Currently, the official packages for .NET SDKs for Azure are confusing and unfriendly to new …
.NET Azure SDK

A Brief Introduction for Azure Front Door

Microsoft Azure had an incident on 11/20, which its Front Door service got a bad deployment and blown-up Office 365, Bing, Azure DevOps, etc. Microsoft engineers very quickly fixed the issue. But Azure Front Door caught my eye, it is new to me. So I took a look. Azure Front Door Typically, when we deploy our web applications to Azure App Service or other clouds, the network flow of a …
Azure Front Door

Generate a True ICO Format Image in .NET Core

A while ago I finally completed the dynamic generation of favicons for my blog system. As we all know, favicon must have an icon in .ico format, and the rest can be output as png files and a manifest.json. However, this ICO format let me struggle for a while. I'd like to share my solution. The Problem with Built-in API As many of you may know, System.Drawing.Image has a Save method that allows …
.NET Icon