Save Time With Azure and the Magic of PowerShell Jobs

I was working on a project where I needed to drop and create Azure SQL databases repeatedly as I tested and tried different scenarios. Of course you start out thinking, “I’ll just drop and create them in the portal, it’s easy.” After a couple times clicking around in the portal page, you begin to understand…

0

Add Azure Antimalware Extension to a VM Scale Set

If you’re running a Windows Server 2016 base image, ignore this post because we’ve built Windows Defender in. However, if you’re running Server 2012R2, for example, and wish to apply the Microsoft Antimalware Extension to an existing VM Scale Set, here is a PowerShell script to do it: # Add the Microsoft Antimalware Extension to…

0

How to Trap Uncaught Exceptions and Avoid 5xx Errors in ASP.Net WebAPI

I was recently writing a WebAPI 2.x project for a customer that involved file IO, decompression, and database IO. Though the things the API does are not complex, there are many things that can go wrong in any of those types of operations that can cause exceptions to be thrown (SQL parsing errors, IO errors,…

0

How to Remove the Server Header from WebListener

Sometimes enterprises or those hosting web sites wish to remove the Server HTTP response header so they can make it more difficult for an attacker to determine what type of web server they are using (IIS, Apache, etc). Though it is doubtful as to how much protection this actually provides, it is still a common…

0

How Do I Set Up A .Net Core WebListener With SSL?

I’ve been doing a lot of research on Service Fabric and Windows Docker Containers lately. These are natural platforms for .Net Core, which added another learning item to my list: .Net Core. As a result, I set out to get a .Net Core WebListener web server up and running on Windows Server Core 2016. I…

0

How Do I Open Ports with PowerShell?

If you have a history with Windows, you’re probably used to using netsh to open ports on the Windows Firewall. We have a whole slew of PowerShell cmdlets to administer the Windows Firewall now and I wondered how to use PowerShell to open ports. It took me longer than it should have to do it,…

0

How to Use PowerShell DSC to Prepare a Data Drive on an Azure VM

Introduction I was asked how to automate formatting a data drive on an Azure VM. The drive had been provisioned already when the infrastructure was created via ARM script, however the disk was raw. I developed this solution with Azure PowerShell Desired State Configuration (DSC), Azure PowerShell 1.0 (newest release as of April 2016), and…

0

How to Convert a VMWare VMDK to Hyper-V VHD

A customer, who is a VMWare shop, gave me a VMDK file of one of their VMs for development purposes. I don’t have VMWare, but I do have Hyper-V on my dev boxes, so I needed to convert the VMDK virtual disk to a format I could connect to a Hyper-V VM. Microsoft offers a…

25

C# Code to Zip Files and Upload to Azure Storage

If you need code to zip some files into an archive and upload it to Azure blob storage, here is a sample for you. Once the data is in Azure Storage, you could use the WebJobs SDK to trigger your Azure application to work on it (for example, ETL into Azure SQL Database). Create a…

2

Script to Perform Azure SQL Premium Failover

** I believe this post is now out of date due to some recent work by the product team, though I have not had the time to try their work yet. Please see this article, it looks to me like there is now a single cmdlet to failover now. My post below was a year before…

2