I recently created the Reverse Proxy site extension which configures your Azure WebApp to act as a reverse proxy and forward web request to other URL’s based on the incoming request URL path.

The extension enables the proxy in the applicationhost.config file of your WebApp. You can configure the proxy by adding rewrite rules in your web.config file.

To enable this extension on your webapp, go to the new portal (portal.azure.com) and find the webapp you would like to extend.

Click on “All settings” and select “Extensions”

Click on the “Add” button and select the ReverseProxy site extension.

After accepting the legal terms (don’t worry its open source) the extension will be installed.

Clicking on the “Browse” button will open the ReverseProxy page of your site, where you can add or edit the proxy rules. This page is just a first step. I hope to create a better experience in the near future. Because you’re already logged in to the azure portal you don’t need to login again for this page.

If your site doesn’t have a web.config yet, it will automatically create one with the above example. This example adds a virtual “ch9″ folder to your site and the content in this folder will be pulled from the channel9 site. (This is just a simple example, a lot of links in the channel9 site will not work. See github documentation for more advanced examples).

If you already have a web.config, the site extension will not mess with it until you put in a rule and click the “Save to web.config” button.

As a consultant primarily focused on Azure I get a lot of different new projects to give advice on how to migrate to Azure.

The first thing I always try to do is to get an overview of all the things running and find things that might run us in to trouble. The project team and documentation is obviously a good way to start. But to solve this problem quickly, I created a list of tools to help me get an overview.

I don’t recommend to use these tools to [next, next, finish] your production workloads to Azure (some of them are not even capable of doing that). But these tools can be very helpful to quickly get some insight of the work that needs to be done.

Azure Websites Migration Assistant
This tool can be utilized to migrate sites from any Windows web server (Linux coming soon!) to Azure web sites. As part of the migration the tool can create sites and databases if the site needs it on Azure, publish content and publish your database. The minimum supported version of web server is windows 2003 with IIS 6. More info: https://www.movemetothecloud.net/

PowerShell is a great tool for automating simple tasks and also works with Windows Azure.
I personally use it to start and stop a Virtual Machine which I’m not using on a regular basis to save some money. By using these scripts I don’t have to login to the portal anymore to start and stop the VM. There are a lot of other usages for PowerShell and Azure, but I will get to that later.

Let’s start with setting up PowerShell and Azure (you only have to do this once). First you need to install Windows Azure PowerShell, by downloading it here.

The Web Platform Installer installs all dependencies for the Windows Azure PowerShell cmdlets. After installing you need to setup your Azure subscription so that it can be used to manage your services. You can do this by opening a PowerShell command prompt and type:Get-AzurePublishSettingsFile.

After hitting “enter” a browser window opens and (after you logged in) will prompt you to download the .publishsettings file.

Once saved, I used the Import-AzurePublishSettingsFile to imports the .publishsettings file for use by PowerShell. This file includes a management certificate that contains the security credentials.

Now you’re all set to manage your Azure resources from within PowerShell.

Here are some commands to get you started:
To view your Virtual Machines:Get-AzureVM

To start a VM:Start-AzureVM -Name “VMName” -ServiceName “ServiceName”

To stop a VM (The -Force will deallocate your VM, this status will not incur any compute costs.):Stop-AzureVM -Name “VMName” -ServiceName “ServiceName” -Force

Here is how you do it
First you need to deploy your site in debug build configuration, otherwise you’re breakpoints won’t be hit.

Next you need to add your Azure subscription to Visual Studio so you can manage your subscription from within Visual Studio 2013.

To add you need to right click on “Windows Azure” in the Server Explorer (Ctrl+W,L) and select “Import Subscriptions…”

Import Subscriptions…

A popup will appear.

Download and Import your subscription into VS2013

If you haven’t downloaded your subscription file before, you can download it via the “Download subscription file” (1).

After downloading you can select that file via Browse (2), and click on Import (3).

When the import was successful, you can manage all your Azure services from within Visual Studio.

Now you can see your Web Sites under the Windows Azure node in Server Explorer. Right click on the site that you would like to debug and select Attach Debugger. When this is invoked the remote debugging agent will be started on your web site.

When the debugger is attached ALL the breakpoints from every request to the site will be hit. So don’t use this on a site with a lot of users

To filter the requests from only your IP address you can add a filter to your breakpoint by right clicking on your breakpoint and select “Condition…”.

Add breakpoint filter

The following popup will appear.

Filter on IP Address

As you can see in my code above, I assigned the Request.UserHostAddressip to a local variable ip.string ip = Request.UserHostAddress;
So now I can add the condition to check if ip is my IP address. The breakpoint will only be hit if this condition is true.

It would be a lot easier to set the condition to: Request.UserHostAddress == "1.1.1.1", but that didn’t work… Probably because the debugger doesn’t have the Request object in scope. Do you have a better idea?

Haishi Bai (Technical Evangelist at Microsoft) is creating a nice series of videos about Windows Azure Cloud Patterns.

The videos summarizes common patterns and practices in using Windows Azure with topics like: long running tasks, competing consumer pattern and priority queues.
Check it out on Channel9: http://channel9.msdn.com/Series/Cloud-Patterns

On the Build conference Microsoft announced a new feature called auto-scaling. This enables you to setup automatic scale rules based on the activity of your instances – allowing you to automatically scale down (and save money) when they are below a CPU threshold you define, and automatically scale up quickly when traffic increases.

The auto-scaling feature is also available for Cloud Services and Virtual Machines, but in this post I’m only going to talk about Azure Web Sites.

To set up a new rule you log in to the portal. Go to the web site you want to automatically scale and click on the tab “Scale”. The feature is only available in the STANDARD mode.
In the picture below I configured my test website (called “autoscale”) to use a minimum of 1 instance and a maximum of 4 instances.
The Target CPU slides says it will scale up when the average CPU utilization comes above 75 percent and will scale down an instance if the utilization drops below 30 percent.

In the gray box you can read “Autoscale has reduced your costs by up to 50%“. This is Microsofts way of saying that you’re using 2 instances (50% of my maximum of 4).

In the graph you can see I have been testing the service by doing some load test on the site. In general the autoscaling feature worked great. Only thing I noticed is that it sometimes takes up to 30 minutes before the site scaled up.

Last week was Teched 2013 North America, and there were a lot of exciting new announcements made by Microsoft. If you have 3 hours to spare… watch the complete keynote here.

Here’s a summary of all the new thinks I found on Windows Azure.

Stopped VM’s will not be charged anymore
This is a great feature for my development and test environment where I always had to remove the VM to stop the charging.
As a bonus Microsoft changed from charging by the hour to charging by the minute!

MSDN Subscription benefits
As a MSDN Subscriber I’m excited about the new improvements. I can now use more resources, have the legal right to use the dev/test server licenses provided by my MSDN subscription and have a nice overview of my credit usage in the portal. (Read the detailed blog post by Scott Guthrie).

SSL Support with Azure Web Sites
If you put your site in Reserved mode you have the ability to upload a SSL certificate for your custom web-site domains. Don’t forget to select the SSL Binding after you upload your certificate… It took me an extra coffee break before I figured out why it didn’t work right away

BizTalk Services
Microsoft announced a new service called BizTalk Services. It is a managed services which provide integration capabilities for the Windows Azure Platform to extend on-premises applications to the cloud. To try the new service you have to sign up via the Preview Features page in the portal.

Watch this episode of Cloud Cover show for more details.

Windows Azure Pack
Windows Azure Pack is the new name (and next version) of “Windows Azure Services for Windows Server” expected later this year.
The Pack will be an installable feature for Windows Server 2012 R2 and will bring some of the features that are currently Azure-only to the server platform.

Watch the video of Scott Guthrie wearing a BLUE shirt(!) talking about the Windows Azure Pack.

Today Microsoft announced a bunch of new updates on Windows Azure. Here’s a sum up of the updates announced today:

Windows Azure Active Directory Reaches General Availability
Windows Azure Active Directory (AD) has reached general availability and is now ready for production use!
Vittorio Bertocci also announced some new features: read his blog.

Backup and Recovery Services
A new service announced today is the ability to enable backup and recovery protection with Windows Server. You can manage your cloud backups from the familiar backup tools in Windows Server and System Center Data Protection Manager to provide a consistent experience configuring, monitoring and recovering backups across local disk and cloud storage. More info can be found here.

Monitoring and Diagnostics Improvements on Azure Web sites
Azure Web sites is still in preview, but got some new monitoring and diagnostic capabilities. This includes the ability to easily turn on/off tracing and store trace + log information in log files that can be easily retrieved via FTP or streamed to developer machines.
Read Scott Hanselman’s Blog for all the details.