Chef: Install Knife-azure Plugin

In the last article we discussed about Install and Configure Chef Workstation and Chef Development Kit

In this article we will discuss about knife-azure plugin.

knife-azure plugin is distributed as a Ruby Gem. We have already installed Ruby and Chef Development Kit as well.
To install knife-azure plugin, run: gem install knife-azure
Depending on your virtual machine's configuration run this command with root/administrator privileges.

For this plugin to interact with Azure's REST API, We will need to give Knife details about Microsoft Azure account and credentials. 

1) Sign in to the Azure portal and download a publish settings file from:  to a local file system location, and then refer to this local file in knife.rb file with knife[:azure_publish_settings_file] = "~/myazure.publishsettings"

2) All subcommands for this knife-azure plugin has an argument called --azure-publish-settings-file to allow to specify the path to publish settings file with each command invocation.

In the last article, we discussed about Install and Configure Chef Workstation and #Chef Development Kit 

In this article we will install Knife-azure Plugin.

Knife.rb file will look like:

To ensure everything is configured correctly, execute:

knife azure image list

If above command works then it means knife azure plugin is installed and configured properly.

Verify again by knife azure - -help and it should give all commands that can be executed.

In the Next article we will discuss about Creating a Template for Chef Cookbook

Labels: , , , ,