Edi Wang

Microsoft MVP for Azure

Server and Tools Server, Software Tips and Tricks

Run ASP.NET Core Websites with Windows Server Core on Azure

Microsoft Azure provides App Service that is fully managed to enable you to run websites. However, in some cases, you may still need an IaaS solution like a VM to host your website. This article will show you how to run an ASP.NET Core 2.2 web application on a Windows Server 2019 Datacenter Server Core virtual machine hosted in Azure. About Windows Server Core Windows was designed as an operating …
.NET Windows Azure

Run Classic ASP on Windows 10 and Azure App Service

ASP is an old technology of Microsoft that even before .NET was born. I have used ASP 3.0 to create my first personal blog in 2003. Nowadays, it is hard to find ASP web applications still active on the internet. But we can still bring the 1996's classic ASP back to life on today's Windows 10 and even in Azure. Some history ASP and its successor, ASP.NET are completely different. ASP uses the …
ASP IIS Azure

Path Caveat with ASP.NET Core 2.2 IIS Hosting

ASP.NET Core 2.2 has been in place for some time, with a new feature that can use the new AspNetCoreModuleV2 and deploy with InProcess mode on IIS to dramatically improve performance. These days Azure App Service finally completed the deployment of this new version of the module, I configured my blog to the new module, and it exploded in production. Let's see why and how to solve it. If you don't …
.NET ASP.NET IIS

Prevent Image Hotlinking in ASP.NET/Core Applications

Introduction As a website developer, we sometimes don't want the images on our own website to be directly referenced and showed on other's website. It can cause a lot network bandwidth for our datacenters in some cases, which means costing money for us to pay for the one who use our images. For example, your website is A.com, you have an image on http://a.com/facepalm.jpg and B.com used your …
.NET ASP.NET IIS

Install Linux Subsystem on Windows 10 Fall Creators Update

In the recent Windows 10 v1709 Fall Creators Update, the Windows subsystem for Linux has been improved a lot. Let's see how easy it is now to install Linux on Windows. 1. Enable Windows Subsystem for Linux Because the classic control panel has been hidden, now the quickest way to access Programs and Features is to run appwiz.cpl And then check "Windows Subsystem for Linux" under "Turn Windows …
Windows Linux

How to Redirect Old Domain URL to New Domain in IIS

When you change the domain name for your website, you are definitely going to solve the migration problem. You cannot just stop DNS on your old domain, because this will cause your indexed pages to be deleted by search engines. The correct way is to tell the search engine that you have a new domain name now, which is when the user accesses an old URL, redirect it to the new URL. Take my blog …
IIS URL URL Rewrite

How to Manage Azure App Service in IIS Manager (inetmgr)

The website we created on Azure seems can be only managed in the web portal or in the Server Explorer of Visual Studio. If we would like to use IIS to manage more powerful scenarios, seems VM is the only way. But that's not true. First, the IIS comes with Windows 8.1 can't connect to Azure by default. We need to install an extension http://www.iis.net/downloads/microsoft/iis-manager After install. …
IIS Azure

Azure Website Showing 404 for .woff Fonts in IE

If you are using Website on Microsoft Azure (Currently renamed to Web Apps), you will find the .woff web font is not working in IE, it returns 404. Based on my experience, this is because IIS is not configured to use the correct MimeType. However, we can not operate the IIS on Azure, there's no RDP into an Azure Web Apps backend machine. How can we do that? In fact, after IIS7, the MineType is …
IIS Azure

Get Clear Password from IIS App Pool

Sometimes, in order to get necessary permissions, we will assign domian accounts or local accounts for IIS app pool. For example, it usually happens for SharePoint deployment. However, this is not a secure way, because the password for these accounts are saved in clear text. For local accounts, the password is not readable. But if you are using domain accounts. The IIS Admin can read your …
IIS Security

Run Scheduled Tasks in ASP.NET Application

在ASP.NET里运行定时任务,这是个老生常谈的话题了,撇开那些用per request搞定屌丝办法,目前最好的解决办法只有2种: 1. 如果你有大微软的Azure,可以直接在网站服务中找到Jobs,自己看一下就会了 2. 如果你是屌丝,买不起Azure,就用本文介绍的WebBackgrounder搞 由于ASP.NET是服务器端Web框架,所以一般而言,一个操作的往往是只有收到客户端Request之后才能执行的,如果网站一直没人访问,没有Request进来,如何执行代码呢?定时任务就是这种坑爹场景。 还好,大微软的MVC帝、ASP.NET小王子haacked蜀黍给我们写了个 http://www.nuget.org/packages/WebBackgrounder/ 专门捣鼓这种场景。作为一个屌丝程序猿,和大牛的区别就在于“好编程,不求甚解”。所以我们不必在意它是怎么实现的,只要会用就行 …
ASP.NET Jobs