Skip to content
Daniel Berger edited this page Dec 17, 2015 · 25 revisions

Welcome to the azure-armrest wiki! Here you will find documentation on how to use the azure-armrest gem to interface with the Microsoft Azure cloud platform using Ruby.

A Quick Note About This Library

The azure-armrest gem only supports the Azure Resource Manager (ARM) approach to MS Azure, also known as "V2". It does NOT support the older Azure Service Manager (ASM) interface, also known as "classic".

Getting Started

First, you'll need the gem.

gem install azure-armrest

Connecting

At the moment, the azure-armrest gem requires a service account. That means you'll need a tenant ID, a client ID and a client key. Once you have those, you can create a configuration object like so.

require 'azure-armrest' # Or, require 'azure/armrest' - either one will work.

conf = Azure::Armrest::ArmrestService.configure(
  :tenant_id       => "xxxxxxxxx",
  :client_id       => "yyyyyyyyy",
  :client_key      => "zzzzzzzzz",
  :subscription_id => "abcd1234xyz" # Optional
)

Note that you are not obligated to provide a subscription ID. However, if you do not, the gem will use the first subscription ID it finds for your credentials.

Now that you have a configuration object, you can pass it to the various "Service" classes. These are basically organized and modeled after the Windows API.

vms = Azure::Armrest::VirtualMachineService.new(conf)
sas = Azure::Armrest::StorageAccountService.new(conf)