kitchen-azurerm 0.8.0 released

Test Kitchen driver for Azure Resource Manager improvements now available thanks to community contributions!

It’s not usually worth a blog post but since taking some holiday in December 2016 and starting in a new position at Chef in January, I haven’t had as much time to dedicate to fixes as I’d have normally liked. Luckily, the community came through with contributions in that time and I want to call out three different pull requests by three different contributors that have just gone into the latest release:

Resource Tagging of created VMs

It is now possible to add Resource Tags to each created VM when it is created in Azure. This can be helpful for a variety of reasons, not least because the tags are searchable. To use it, simply add your tags like the example below:

platforms:
- name: ubuntu-14.04
driver_config:
image_urn: Canonical:UbuntuServer:14.04.4-LTS:latest
vm_name: trusty-vm
vm_tags:
ostype: linux
distro: ubuntu

Thanks “liamkirwan” for this contribution!

Enhanced networking support for ExpressRoute and VPN users

Early releases of the kitchen-azurerm driver only had support for creating VMs with Public IP addresses attached to their NIC. Later this was changed so you could specify a vnet and subnet, like this:

platforms:
- name: ubuntu-1404
driver_config:
image_urn: Canonical:UbuntuServer:14.04.4-LTS:latest
vnet_id: /subscriptions/b6e7eee9-YOUR-GUID-HERE-03ab624df016/resourceGroups/pendrica-infrastructure/providers/Microsoft.Network/virtualNetworks/pendrica-arm-vnet
subnet_id: subnet-10.1.0

However, sometimes it turns out you need both! So this pull request (thanks to “vlesierse”) added support for a new public_ip parameter that can be set to true if you want the machine to both be connected the specified subnet and have a public IP address assigned for testing:

platforms:
- name: ubuntu-1404
driver_config:
image_urn: Canonical:UbuntuServer:14.04.4-LTS:latest
vnet_id: /subscriptions/b6e7eee9-YOUR-GUID-HERE-03ab624df016/resourceGroups/pendrica-infrastructure/providers/Microsoft.Network/virtualNetworks/pendrica-arm-vnet
subnet_id: subnet-10.1.0
public_ip: true

Use built-in Windows provisioning mechanism for configuring WinRM

For the Windows side of converging on Test Kitchen to work, the VM must be configured correctly for WinRM. This generally involves opening up a listener and configuring the firewall appropriately. The first version of the driver used an Azure Custom Script Extension to add the WinRM configuration after the VM was built. The limitations of this were that it was slow to configure, and there were reports that in a hybrid networking setup, the Custom Script Extension did not work behind a proxy. So thanks to “hbuckle” the driver now injects the configuration required into the unattend.xml — which is the configuration file used to provision the Windows VM before it even boots for the first time!

Updating the Kitchen driver locally

To update to the latest kitchen-azurerm, simply:

> chef gem update kitchen-azurerm

All-in-all, three great contributions from the community that go to enhance support for the Microsoft Azure platform for all users of Test Kitchen!