And a VM in the clouds
February 26, 2015
So we got our shiny new box setup with vagrant-azure. It was as easy as a few commands…sudo pacman -S vagrant vagrant plugin install vagrant-azure vagrant box add azure https://github.com/msopentech/vagrant-azure/raw/master/dummy.box# create our configurationmkdir azure-vm vagrant init gvim VagrantFile# create bunch of certificates for azure management and winrm# see https://github.com/MSOpenTech/vagrant-azure#using-openssl-linuxmacvagrant up --provider=azure Here's the gist for a [sample config](https://gist.github.com/codito/aec6a5bd2d704f930350). If you're not sure which `vm_image` to use, you can get the list with `azure vm image list` after installing [azure command line tools for linux/mac](http://azure.microsoft.com/en-us/documentation/articles/command-line-tools/). **Two diagnostics tips that saved my morning :)** - If you see error messages from `vagrant`, enable the [diagnostic logging](http://docs.vagrantup.com/v2/other/debugging.html) with `export VAGRANT_LOG=debug`, rerun `vagrant up`
- Now we’re onto the part where azure throws cryptic messages like
InvalidXmlRequest:) With all the calmness, we monkeypatch and enable
Net::HTTP.set_debug_outputand examine the REQUEST and RESPONSE xmls. It takes a little trial and error to figure out
winrm_https_portwas empty in the configuration! This gist has a sample of monkey patch in the VagrantFile, just remove the comment from
Net::HTTP.enable_debug!()(thanks to https://gist.github.com/kaiwren/591601). Config as code for the win!