This is an old revision of the document!
Guidelines to install FreeBSD Virtual Machines in Microsoft Azure.
What is Azure?
Azure is Microsoft's interpretation of what a cloud service means. The main objective is to make it possible for any company building services on the Internet to develop their business and scale without making a huge initial investment. While Microsoft offers their own technologies, a big part of the world doesn't so they have full interest in supporting the alternative unix-ish technologies that make up the Internet today. Not unlike other cloud providers, from the point of view of a FreeBSD user, Azure is a “virtual” hardware provider: they have huge clusters around the world and without you worrying about disk failures or temperatures you make use of them for a fee.
Azure is still evolving and as a consequence you will find a "Classic" and a Portal. You can still manage some classic services through the new Portal but some other things can only be done in the Classic Portal.
How is FreeBSD supported?
Microsoft has invested in porting their virtualization support (Hyper-V) for FreeBSD. Hyper-V support is available for FreeBSD-9 through the ports tree, but starting with FreeBSD-10 support for Hyper-V is included in the main tree. FreeBSD is not officially supported within Azure yet (2015) so you have to go through a process of building your own Virtual Machine. This said, support for FreeBSD seems to be somewhat better in the “Classic” mode.
What do I need?
* You need to have an account with the Microsoft Azure service: generally there are free trial accounts and if you are a MSDN subscriber you may already have access.
* [UPDATE] Starting with 10.3, Microsoft offers FreeBSD directly as a Virtual Machine option, just search for it.
* You may want to use the Azure CLI. This is JavaScript (node.js) application so it is possible to do this from FreeBSD. Some things are better done through the portal though.
Using an image from the VM Depot
Using an image from the VM depot used to be the best option before 10.3: Microsoft's Ross Gardler did an excellent tutorial [2].
If you still need this for some reason, some tricks to have in mind:
- Before transferring the image. You are likely to have to create a *classic* storage resource in your region. This is most easily done through the portal.
- You may have to go into the classic Azure-SwitchMode: azure config mode asm.
- Once up and running: freebsd-update(8) and pkg(8) upgrade are your friends.
Building your own image
Building your own image has the advantage of letting you do some initial customization with a virtualization engine. VirtualBox works fine with VHD images. The obvious disadvantage is that it will take some time to upload big images if you are in a slow network.
If you follow the tutorials from Microsoft employees keep some tricks in mind:
- You can build the image with a virtualization tool different that Microsoft's Hyper-V but you still will need the Azure CLI.
- There is actually no need to use wget on FreeBSD: You can use fetch(1) or even better, you will notice the python agent required by Azure is already in the ports tree so you can install it with pkg(8).
- Try to keep you images small so that uploading them won't take too long. Once uploaded, the networking is fast enough that you can use pkg(8).
References:
[2]Deploy and Customize a FreeBSD Virtual Machine Image on Microsoft Azure
[4]How to install the Azure CLI
[5]Use and Commands available in the Azure CLI
[6]Creation and upload of a VHD with a Linux-based OS