Azure


A Brief Introduction for Azure Front Door

Microsoft Azure had an incident on 11/20, which it's Front Door service got a bad deployment and blown up Office 365, Bing, Azure DevOps, etc. The issue was fixed very quickly by Microsoft engineers. But Azure Front Door caught my eyes, 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 Remote Controlled Light with .NET Core 3.0 on Raspberry Pi

3 years ago, I wrote a blog post "Azure Remote Controlled Light with Windows 10 IoT Core", which is an experiment to sending a signal from your home and it will travel around the world then come back to your home to turn on an LED light on your Raspberry Pi. 3 years later, Windows 10 IoT Core and UWP seem not living so well. Microsoft doesn't have a new build of Windows 10 to support the latest …


This Blog Now Runs on .NET Core 3.0 and Azure

Microsoft shipped .NET Core 3.0 GA on Sep 23rd with tons of new features and improvements. This blog has been updated to .NET Core 3.0 and still runs on Microsoft Azure with SCD deployment type on App Service. This blog post summarizes all key points for my blog migration. Starting with .NET Core 3.0 preview 8, I've been investigating migration for this blog, from .NET Core 2.2 to .NET Core 3.0. …


Migrate Azure Application Insights to ASP.NET Core 3.0

.NET Core 3.0 will be released at this month's .NET Conf conference, many of my friends, including me, couldn't wait to use the preview version to migrate our apps. Fortunately, starting with Preview 7, the API surface is final and can be treated as an RC version. There should be no API difference between preview 7, 8, 9 and RTM. Today I will talk about migration tips for Azure Application …


Setup Experimental Machines with Azure DevTest Lab

Programmers and test engineers always need to set up their own environments for development and testing purposes, and these machines may only be in use for a short period of time. Typically, we use virtual machine products such as Hyper-V and VMWare on the local machine, or we use virtual machines assigned by enterprise IT administrators to do the work. However, installing and managing these VMs …


Deploy Ontology Blockchain DevTest Machine on Microsoft Azure

Learning blockchain development requires development and test environment. However, it is way too difficult for me to manually set up a dev-test machine because I am completely new to blockchain and it's development workloads. Fortunately, Microsoft Azure offers virtual machine images that allow vendors to publish pre-configured images to the Azure marketplace and distribute them across Azure. …


Create Azure Function App with .NET Core and CD from GitHub

Azure Functions is an event-driven serverless compute platform that can also solve complex orchestration problems. Build and debug locally without additional setup, deploy and operate at scale in the cloud, and integrate services using triggers and bindings. For me, Function can help me quickly develop some simple APIs, and I just need to write business code instead of building fundamental code …


Create a Private DNS Server without VM on Microsoft Azure

In many companies and organizations, IT administrators typically configure internal private domain names that are inaccessible to the Internet for access to internal resources. For example, if my domain name is edi.wang, I want to use internal.edi.wang for access to the organization's internal resources. We have to install and configure our own DNS server on either Windows or Linux for this in …


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 …


Run Office 97 on iPad with RDS on Microsoft Azure

Apple has been trying to make the iPad as a computer, but it's never as good as a real PC. If you can run PC software on an iPad, such as a full version of Office, that would be an ideal way. The first software I used when I was a kid was Microsoft Word in Office 97, which was the first version to introduce an Office Assistant (Clippy). In honor of Clippy that died at the age of seven, I decided …


How I Built This Blog with Azure Services

My website (https://edi.wang) is an open-source blog system written in .NET Core and runs on Microsoft Azure. This article explains why and how the blog benefits from Azure's services. History of this blog The history of my blog dates to 2003, and the .NET version of the blog was originally built 10 years ago by the ASP.NET 2.0 WebForm VB and Access database and has been gradually maintained …


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 …


Reset Azure Blob Storage Content Type in .NET Core

My blog is using Azure Blob Storage to store images for posts, however, it went wrong these days when I am trying out Azure CDN, the cause is all my images requests are returning incorrect content-type. Let's see how to reset content type for files in Azure Blob Storage via .NET Core. When I uploaded images using the Azure Storage API for .NET, by default, without setting ContentType, which is …


Fix .NET Core Website Failure After Deployment from Azure DevOps

I met a strange problem recently. After configuring the CI/CD pipeline with Azure DevOps and automatically deploy to Azure App Services, the. NET Core Website failed to start. Let's see how we can solve this problem. Find the issue First of all, fortunately, this is a staging environment. I found that the site unexpectedly did not log anything, even log directory cannot be found, which is …


Fix Azure DevOps TF14045 Error When Deploy to Azure

I encountered an error when I try to setup CI/CD in Azure DevOps, I tried to deploy a .NET Core application to Azure App Service, but Azure DevOps won't connect to Azure. This is a known issue for Microsoft. Let's see how we can manually setup a connection between Azure DevOps and Azure to workaround this issue. First, the error message I met was: Failed to get resource ID for resource type ' …


Detect Text Language using Azure Cognitive Services in .NET Core

There are many ways to identify what is the language of a text, in this era of AI, we can also add AI capabilities to our own application. I will show you to see how to use the AI Cognitive Service provided by Microsoft Azure to detect the language of a text. The prerequisite is that you will need an Azure subscription. Create Azure Cognitive Services Account Click "Create a resource", then …


Integrate Azure Application Insight Data into Your Own App

Microsoft Azure has a very powerful monitoring tool called Application Insights. It can monitor every aspect of our web application, including client and server metrics, error details, performance and so on. My blog is also using Application Insights, but everytime I want to see the data, I have to go to Azure portal, even for the basic metrics like page views or server response time. I want a …


Build .NET Core 2.2 Projects on Azure DevOps

.NET Core 2.2 has been release for couple of weeks. However, the build pipeline is still failing these days. Microsoft has not installed .NET Core 2.2 SDK to the hosted VS2017 agents yet. Let's see how to work around this issue and have a success build for our .NET Core 2.2 apps. 1. Add Task Edit your build definition, and click the "+" button to add a new task. 2. Add .NET Core SDK …


微软Azure予力Green Dot客服成就不凡

碧点公司(Green Dot)是仔细聆听消费者心声,以消费者为导向的金融科技创新公司,致力于为大众带来高效、便捷与体验舒适的个人银行业务。Green Dot创造了预付借记卡产业,也是美国最大的可增值预付借记卡和现金充值业务服务供应商。 在2018年11月23日-24日举办的GreenDot Hackathon活动上,来自Web团队的四名开发人员 Edi Wang、Eric Wang、Emon Zan 和Jimmy Yang 组成的 “TBD” 小组,将微软智慧云Azure的人工智能服务与公司客服业务紧密结合,实现了人工智能赋能客服机器人的效果。该机器人能够理解人类自然语言,并在实时聊天中使用语音或文字准确回答用户提问,这将极大缓解人工客服的压力。 传统客服经常需要面对复杂的用户提问,而这些提问可以总结为几个常见问题,我们称之为 …


Migrate Domain DNS to Azure

It has been a while since Azure DNS went GA on Azure. It's like "dnspod" in China, offers a third party DNS services besides your domain register. The power of Azure has already been witnessed by the entire human race. Now that, it has got DNS services, it would surly be the best in class DNS on the planet. Thus, what we have to do, is to migrate our DNS servers to Azure DNS. So that …


Configure Continuous Delivery for ASP.NET Core Website on Azure

Today I am trying new DevOps tools in VS2017 and Azure, my goal is to automate the process from development to production for an exsiting ASP.NET Core project. I have encountered some issues, and with the help of Microsoft Support, I was able to solve them and share with you guys. First, there are two ways to configure CD for Azure Web Apps. I prefer create a website first, then configure it …


Azure Fire Alarm by Raspberry Pi and Windows 10 IoT Core

防火是日常生活中非常重要的意识,如果你是一只恩爱狗,出门在外,家里被FFF团点了,那真是太惨(hao)了。如果你恰好有Windows 10的设备,比如Lumia,Surface,能及时收到火警是至(mei)关(sha)重(luan)要(yong)的。今天就教大家如何用Microsoft Azure公有云+Windows 10 IoT Core在树莓派上实现一个远程火警系统。 阅读这篇文章,你需要的前置知识: Windows 10,UWP的基本开发能力 MVVM基础知识 ASP.NET MVC的基础知识 树莓派、GPIO及逻辑电路的基本知识(也就是大学里的计算机电路) Azure公有云的使用经验 ……当然,还要有对微软的信仰 一、设计原理 基本想法是,通过火焰传感器的输入信号,触发一个警报,把消息发送到Azure上的Notification …


Raspberry Pi Surveillance Camera with Linux and Azure

Because Windows 10 IoT Core is not supporting Pi Camera, I can only use Linux instead. These days, I made a surveillance camera, the functionality is simple, when a person passed by the camera, it will take a picture and upload to Microsoft Azure Storage. It also got a website to remotely view the photos. 1. Hardware A PIR Sensor, a Pi Camera, a couple of jump wires. Connect the Singal …


Uploading PiCamera images to Azure

Recently Windows 10 IoT Core Build 14393 is coming, but still without PiCamera support, WTF. So I can only choose Linux for my project. When I was using Windows, I use C# + Azure SDK to upload photos to Microsoft Azure. So how to do it on Linux? After some research, here's how to do it. My system is Raspbian Linux. First, we need to install Azure SDK in SSH Terminal: sudo pip install --pre …


Azure Remote Controlled Light with Windows 10 IoT Core

For those who have watched the "Big Bang Theory", you would probably remember that those physicists build an Internet controlled lamp. The signal send from their laptop traveled around the world and come back to their house to light up the lamp. Now, with Windows 10 IoT Core and Microsoft Azure, we could also achieve the same thing on a Raspberry Pi 3. First, I strongly recommend you …


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 …


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 …


Azure SQL数据库如何做定期自动备份

Azure上的数据库可以通过手工export来备份,方法我在博客里写过。但是如果要求定期做的话,需要人工参与。偷懒的做法是用Azure自带的定期备份功能。 1. 在Azure Portal点开你的数据库,切换到CONFIGURE页面。 Automated Export的意思就是自动导出数据库(bacpac格式),默认是NONE,也就是不自动备份。选择AUTOMATIC。 2. 选完之后,下面会出来详细设置。 STORAGE ACCOUNT选你要保存备份文件的存储账户。FREQUENCY是频率,这个例子里我选择每28天备份一次,从2015年4月2日12:00A.M.开始。保留90天内的备份(这个选项的意思就是备份文件多久以后会被自动删除) 另外,还需要填写SQL数据库服务器的登录账户和密码。然后保存设置就完成了! 3. 一旦到了指定时间,触发了备份。你就能在你刚才设置的存 …


Azure SQL数据库Web Tier爆了,如何迁移数据库

今天做了次数据库迁移,目的是开个最新版的Azure SQL Database(V12 Update),然后把博客的数据库迁移到新的server上去。按以往的做法(也就是我曾经写过的《图解:如何将SQL Server数据库迁移到SQL Azure 》),把bacpac文件下载下来,然后import到新的数据里,结果爆了: 爆炸是因为Web Tier和Business Tier在最新版的Azure上面已经被微软撸掉了,SSMS 2014却没有升级,不认识这两个Tier,还在用老的Web Tier。 TITLE: Microsoft SQL Server Management Studio ------------------------------ An exception occurred while executing a Transact-SQL statement or …


How to move Microsoft Azure Application Insights

本文目前仅适用于国际版的Azure,国内版没有Application Insight服务,请注意。如果你还没有感受过Application Insight这个人类的最新希望,可以到大微软的Channel 9电视台学习一下:http://channel9.msdn.com/Series/Application-Insights-for-Visual-Studio-Online 另外,本文所说的迁移方法不会保留Application Insight的历史数据,如果你看到这里就想喷:你TM在逗我?这叫什么迁移? 。。。 那还是别往下看了。我的标题叫迁移,是因为我实在找不到别的词了。 如果你换了个Microsoft Azure的订阅,怎么迁移以往的ASP.NET, WP工程上面已经配置好的Application Insight呢?目前Azure Portal没有提供更改订阅的功能。所以我们只能 …


如何定时开关机Microsoft Azure上的虚拟机

作为一个屌丝,用Azure的时候得处处想着省钱,在你不用虚拟机的时候关机是个省钱的好办法。当然,每天手动登录Portal去开关机比较麻烦。如果你用VM的时间段比较固定,可以做个定时开关机的任务帮你省钱。 做法是用一台机器作为Controller,在上面建立开关机任务,调度Azure上的VM。比如你自己的机器每天早上8点开机,下午5点关机。你希望Azure上的某台VM早上8:30开机,下午4:30关机。那你就可以把自己的机器作为Controller。当然,你也可以在Azure上开一台专门作为Controller的Server,给它分配一个768MB内存的屌丝instance(diaostance)来省钱。 这台Controller机器上必须安装Microsoft Azure PowerShell,并且要在PowerShell里登录一次Azure。本文不再叙述,具体做法请看我之前写的《图解 …


图解:如何在Visual Studio 2013中连接中国版的Azure

VS2013的Server Explorer在第一次连接Azure的时候默认弹出的登录框只能登录国际版的Azure。但是国内很多屌丝没有国际版怎么办呢?其实国内世纪互联运营的windowsazure.cn也可以通过导入订阅的方式来连接。 1. 登录国内版Azure之后,访问这个地址,下载你的订阅文件:https://manage.windowsazure.cn/publishsettings/index 2. 在VS2013里打开Server Explorer,不管你有没有连接到国际版的Azure,这里操作方法都是一样的。在“Azure”上点右键,选择“Manage Subscriptions...” 3. 在弹出的对话框里,选择“Certificates”选项卡,然后点击“Import& …


图解:使用Azure PowerShell创建和删除虚拟机

昨天教了大家如何使用Windows Azure PowerShell启动和关闭虚拟机,但光会用PS开关机还是不够的。如果你还在用网页版Portal创建和删除虚拟机,而只用PS去开关机,逼格明显就不完整了。所以今天再教大家如何用Windows Azure PowerShell创建和删除虚拟机,完成整个装逼过程。 首先,使用Windows Azure PowerShell登录Azure账户的步骤不再重复了,上一篇文章里有。假定你已经登录了。 如果你想查看虚拟机列表命令是: Get-AzureVM 1. 要创建虚拟机需要获得一些前置信息。第一个是你的订阅名称。运行这条命令获得: Get-AzureSubscription 在我的例子中,结果是Windows Azure MSDN - Visual Studio Ultimate。这是一个一年价值12w的订阅,大家不要在意这些细 …


图解:使用Windows Azure PowerShell启动和关闭虚拟机

我们在使用Azure的时候,如果只会用网页版portal操作是没有逼格的。如果你不在命令行里啪啪啪的敲点东西,就会被Linux狗、Java狗、开源狗鄙视,他们会说用微软产品的人只会用图形界面,微软的程序员只会拖控件。为了挽回我们的逼格,大微软提供了Windows Azure PowerShell,能够让我们以命令行方式操作Azure。今天就教大家如何用Windows Azure PowerShell启动和关闭你的虚拟机。 如果你没安装Windows Azure PowerShell,可以通过大微软的Web Platform Installer安装,本文不再啰嗦怎么安装,反正WPI都是一键搞定的。 启动Windows Azure PowerShell后,第一件事就是要登录你的Azure账户。键入以下命令后会弹出登录界面: Add-AzureAccount 登录完成后, …


Windows Azure的计费方式和省钱的最佳实践

我从去年9月开始试用国内的Windows Azure,同时也有一个国际版Azure的账号。目前国内的Windows Azure还没有出台计费标准和细则,所以这篇文章里不会提及具体费用,但可以下载每月使用记录来观察和总结计费规律。国内的计费规则和Azure国际版是一样的,但是具体标准还没出来。写这篇文章的目的是总结一下我遇到的问题和经验,以帮助大家如何更经济的去使用Azure的服务。 一、计费周期和订阅 Azure的计费是跟着订阅走的,一个账户可以拥有多个订阅。我使用的主要是网站和虚拟机两个服务。就目前的情况来看,免费试用套餐一不小心就会超额被禁用。一旦订阅被禁用只能等到下个计费周期开始才能继续使用。比如我的订阅是9月9日开通的,那我的计费周期就是每月的9日到下月的8日。如果我在10月份超出了额度限制,那我在Azure上的所有服务都会暂停,并且要等到11月9日才能重新恢复。 被禁用的订 …


Azure Blob Storage 编程简单入门

Microsoft Azure上的Storage服务看起来非常牛逼,它是用来在云端存储数据和文件的服务,比如Azure里的虚拟机就是保存在Storage中的。当然我们可以用Storage做更多的事,比如有些数据并不适合存放在关系型数据库中,就像图片和附件,我们就可以使用Storage服务。 今天介绍的是Storage里的一种,Blob Storage。Windows Azure Storage还有其他两种存储:Table和Queue,但是我只开荒过Blob Storage,所以其他两个就只能以后介绍了。 使用Blob存储首先得建立一个Storage Account,Account中包含的是Container,这类似于文件夹,最后你的文件会存放在Container下,也就是Blob。 它们的关系就像这样(可耻的盗用了一张Azure官网的图片): 一、在Azure管理页面 …


Windows Azure部署NuGet服务器爆掉的解决办法

因为公司网络的限制,没有办法访问NuGet的官方地址 https://nuget.org/api/v2/ 。所以我只能在Windows Azure上搞了个私有的NuGet服务器。本地测试一切正常,但是部署到Azure以后,查看package list的时候爆了: 根据提示,只要更改web.config的一个配置就行: <system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel> 然后在VS中重新部署网站到Windows Azure,因为是差异部署,只需要覆盖web.config就行。很快我们 …


Windows Azure中如何将SQL数据库转移到别的Subscription下

今天本屌丝怀着无比兴奋的心情,去参加了微软在上海举办的Azure训练营活动。又得到了一个Azure账户,并且也感受到了人类的希望。自从用了Azure以后,我逼格提升了,博客服务稳定了,就连三观也恢复了!妈妈再也不用担心HTTP 503了! 拿到新账户以后,我把Co-Administrator交给了我outlook.com上的的主账户。这样我用outlook账户登录,就能看见除了猿来的MSDN Subscription以外的另一个账户了。并且可以在一个账户中集中管理所有的内容,屌炸天了!#微软,人类的希望# 那么,在实际场景中,不同的Subscription可能是不同的人持有的,如果我们想把现有账户中的Azure Service转移到别的账户中,肿么办呢?如果重新部署的话,意味着风险和服务中断。幸好,光荣、伟大、正确的微软已经给我们提供了这么一个选项,能够在几秒内平稳将服务迁移到别的 …


图解:如何将SQL Azure数据库备份到本地SQL Server

用了两天SQL Azure后,发现SQL Azure数据库没有办法做传统意义上的“bak”备份,但我们确实很需要能够随时将数据库备份到本地,以更灵活的使用。所以今天就开荒了一下操作方法,并分享给大家。这样一来,我们既可以把SQL Server迁移到SQL Azure,又可以反过来把SQL Azure撸回SQL Server,这是一个比较完整的装逼过程,妹子们一定会赞不绝口。 步骤如下: 1. 启动SSMS2012,在目标SQL Azure数据库上点右键,选择“Export Data-tier Application”。 2. 在Export Settings选项卡里制定本地的备份路径,现在已经是“bacpac”拓展名的了。。。 3. 然后点击Next,确认后就向导就开始撸了。 4. 撸完以后会显示 …


图解:如何将SQL Server数据库迁移到SQL Azure

最近为了进一步装逼,决定将本博客的数据库从SQL Server 2008 R2迁移到Windows Azure上,即SQL Azure,云数据库。今天花了半天时间成功完成了迁移,把经验拿出来给大家分享。 注意:本文的方法只在SQL Server 2008 R2和SQL Server 2012数据库上试过,其他版本生死未卜。 首先,不管你现在的数据库是MSSQL2008R2的还是MSSQL2012的,你都需要安装SQL Server 2012版的SSMS。这是最方便的迁移方法。如果不想用SSMS,可以试试codeplex上的这个工具:http://sqlazuremw.codeplex.com/ 1. 启动SSMS后,在要被迁移的本地数据库上点右键,选择Tasks - Deploy Database to SQL Azure... 2. 在弹出的向导中,点击Connect,连接到 …