Edi Wang

.NET and Azure Developer

Microsot Azure The Best Cloud

Migrating an ASP.NET Core Web API Project to Azure Function

Some time ago, I successfully migrated an ASP.NET Core Web API project to the latest Azure Function V3, thereby taking advantage of the serverless features of the Azure platform to reduce operation and maintenance costs by 10 times. This article will introduce the key steps and practices in the migration process to help you migrate similar Web API projects. Project background This Web API …
.NET Web API Azure Azure Function

Solving Azure AD Sign In Failure with Azure Front Door

Today I am migrating my blog to use Azure Front Door which I have introduced in a previous blog post last year. Everything went well except for the blog admin sign in. I configured my blog to Azure AD as SSO. But after I put the blog behind Azure Front Door with my custom domain, OIDC Redirect URL just blow up. OIDC Redirection Failure When I tried to sign in, the redirection URL suddenly went to …
Azure Azure AD Front Door

Use Azure Function to Schedule Auto Start for VMs

VMs on the Microsoft Azure platform can be configured to automatically shut down by schedule. However, currently only VMs in the DevTest Lab service can be powered on automatically. Regular VMs have not been updated with the auto start capability. But still, we can take advantage of Azure Function V3 and PowerShell Core to start the VM by timed schedule. The Idea I have wrote a post 6 year ago …
Azure PowerShell VM Azure Function

Fix 'Cannot Delete Payment Method' for Expired Credit Card on Azure

Recently my credit card for Azure expired. I have to replace it with a new card. But when I added my new card and try to delete my old credit card, Azure pop up an error saying "Cannot delete payment method(s)" and indicates that the card is in use. I was trying to delete credit card from "Cost Management + Billing" - "Payment methods" screen. The reason why Azure won't let me delete my old …
Azure

Import Data to Azure Storage Table from SQL Server

Recently, there was a demand to switch data storage from SQL Server database to Azure Storage Table. However, neither SSMS nor Azure Portal provide a direct import function. You may now consider writing a tool to import data, but actually it isn't necessary. I still managed to do it within mouse clicks. But the first thing to warn everyone is that relational databases like SQL Server are not …
SQL Server Azure Storage

How to Use the Latest .NET Core Runtime on Azure App Service

Microsoft often releases updates to .NET Core, usually as security patches. This morning, the .NET Core 3.1.5 update was released. However, Azure App Service's own .NET Core runtime will not be updated immediately, and we would usually wait a few weeks before Microsoft rolls out the update to Azure. For applications with high security requirements, it is urgent to complete the update before …
.NET Azure App Service

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

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

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