Azure


Load Balancing My Blog on Azure

In order to improve the page loading speed of my blog for US users, I deployed an App Service in West US region on Azure some time ago. Now I have 2 servers running my blog, East Asia and West US. In this post, I'm going to illustrate how to use Azure to load balancing these servers, so that users can get access to the closest server for their regions. Adding Identifier Tags Since the codes …


How to Quickly Fix Dashboard After Moving Resources in Azure

Azure users often need to move resources to another resource group or subscription because they are not rich enough. After the move is completed, the corresponding Dashboard components will become invalid. Usually, we need to delete and rebuild these dashboard cards one by one. Is there a quick and accurate way to repair Dashboard in one step? Moving resources Take my blog as an example, I moved …


Securing My Blog with Azure Web Application Firewall (WAF)

Website developers and operation will inevitably encounter hackers. There are many fully automated hacking tools and scripts on the Internet that can scan your website for known security vulnerabilities and launch fully automated attacks in an attempt to seize control of the server. As a result, businesses often purchase web site application firewalls (WAFs) and deploy in front of the web server …


Test Network Speed Between Azure VMs Using iPerf

When it comes to measuring network speed, you might think of testing the Internet connection speed with the famous speedtest. But in fact, just testing the Internet connection speed is not reliable. In some scenarios, the final Internet speed is also affected by the your infrastructure like the connection to your ISP's server. Therefore, it is very important to know where your network performance …


How to Restore Connection After Accidentally Disabled NIC on Azure VM

Normally, we uses cloud based VMs through SSH or RDP, so a network connection is necessary for connecting to the VM. But what if you accidentally disabled the NIC on your cloud VM? You may want to call Azure Support or find a previous snapshot for restoring VM. That's not necessary! Azure can help you restore your NIC by yourself in a few steps. Experiment I created a Windows Server 2019 VM on …


Configure URL Redirect on Azure Front Door

Azure Front Door is a global entry point service for websites. Including features like DDOS, WAF, website failover. I have introduced it in "A Brief Introduction for Azure Front Door". This article specifically introduces the usage of URL redirection in Azure Front Door. When to do URL redirection URL redirection is mainly used to redirect users to a new location of a resource. The most common …


Setup a Private NPM Server on Azure in 45 Seconds

Recently, my company needs to use a private NPM server. I did some research and finally chose verdaccio, an open source and free product. However, the environment setup is a huge trouble. Since it is Linux friendly, but my company only has Windows Server 2012 R2, I have to follow the incorrect official document and Googled a lot, finally it took me nearly 5 hours to install on the server. During …


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 …


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 …


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 …


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 …


Import Data to Azure Storage Table from SQL Server

Recently, there was a demand to switch the 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 …


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 roll out the update to Azure. For applications with high security requirements, it is urgent to complete the update before …


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 …


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 …


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. …


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

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


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 …


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 operating …


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 and …


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 very …


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 Installer …


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 your website …


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 from …


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 Hub,这个服务是专门给 …


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 port of …


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 …


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 to read …


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. …


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 batch. …


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”按钮,把刚才下载的订阅文件导入。 4. 导入成功以后应该是这个样子的。 5. 接下来,你就能同 …


图解:使用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的一个配置就行: 然后在VS中重新部署网站到Windows Azure,因为是差异部署,只需要覆盖web.config就行。很快我们就能看到效果了: 至于如何自己建一个NuGet服务器,方法也非常简单。只要创建一个空的ASP.NET Web Application,然后添加NuGet.Server包就OK了。最后把你需要的NuGet包文件(.nupkg)扔到网站的Packages目录下就行。


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. 撸完以后会显示Operation Complete的消息,现在本地备份文件已经创建完成了。 5. 在 …


图解:如何将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,连接到你在 …