Ruby SDK for Azure Resource Manager: build and manage your Azure cloud infrastructure (Compute, Virtual Networks, Storage, etc...) using Ruby.
Ruby SDK for Azure Resource Manager: build and manage your Azure cloud infrastructure (Compute, Virtual Networks, Storage, etc...) using Ruby.
This project provides a Ruby package for Azure Resource Management (ARM). If you're looking for Azure Service Management (ASM) please refer to this repo
Additional info on Azure deployment models https://docs.microsoft.com/azure/azure-resource-manager/resource-manager-deployment-model
As of February 2021, Azure Resource Management SDK for Ruby has entered a retirement phase and is no longer officially supported by Microsoft. Here is the complete list of packages that are affected by this. We are committed to making critical security and bug fixes for libraries in this repo until December 31, 2021. After that date, this repo will no longer be maintained.
For current users of the Azure Resource Management SDK for Ruby, we have prepared a migration guide that points outlines different alternative approaches you can take moving forward. Please check the guide here.
Thank you for your support so far. Should you have any question, please feel free to open an issue on GitHub.
All resource management Azure Resource Management packages that contains “azure-mgmt” will be retired as well as a few client libraries.
Note that the Azure Storage SDK for Ruby is excluded from this retirement and continues to be maintained. The Azure Storage SDK for Ruby is available in its own preview gem and GitHub repository, which is still being maintained
Below is the list of the packages that are being retired
Note: x64 Ruby for Windows is known to have some compatibility issues.
You can install the azure rubygem packages directly.
gem install azure_mgmt_compute
gem install azure_mgmt_storage
gem install azure_mgmt_resources
gem install azure_mgmt_networkOr use them in your Gemfile.
gem 'azure_mgmt_storage'
gem 'azure_mgmt_compute'
gem 'azure_mgmt_resources'
gem 'azure_mgmt_network'Be aware the Azure Resource Manager Ruby SDK is in preview and will likely have breaking interface changes in upcoming releases. An increased number in Minor version may indicate breaking changes.
The first step to using the SDK is authentication and permissions. For people unfamilar with Azure this may be one of the more difficult concepts. For a reference on setting up a service principal from the command line see Authenticating a service principal with Azure Resource Manager or Unattended Authentication. For a more robust explanation of authentication in Azure, see Developer’s guide to auth with Azure Resource Manager API.
After creating the service principal, you should have three pieces of information, a client id (GUID), client secret (string) and tenant id (GUID) or domain name (string).
In order to use the Azure SDK, you must supply the following values to the Azure SDK:
You could pass the above values in the following ways:
You can set the (above) values using the following environment variables:
To set the environment variables, in Windows, you could use the command such as:
set AZURE_TENANT_ID=In Unix based systems, you could use the command such as:
export AZURE_TENANT_ID=The initialization of profile clients take an options hash as a parameter. This options hash consists of tenant_id, client_id, client_secret, subscription_id, active_directory_settings and credentials. Among these, the active_directory_settings and credentials are optional.
You can set the (above) values using the options hash:
options = {
tenant_id: 'YOUR TENANT ID',
client_id: 'YOUR CLIENT ID',
client_secret: 'YOUR CLIENT SECRET',
subscription_id: 'YOUR SUBSCRIPTION ID'
}If you would like to pass in the credentials object, you could use the the following code:
provider = MsRestAzure::ApplicationTokenProvider.new(
'YOUR TENANT ID',
'YOUR CLIENT ID',
'YOUR CLIENT SECRET')
credentials = MsRest::TokenCredentials.new(provider)
options = {
tenant_id: 'YOUR TENANT ID',
client_id: 'YOUR CLIENT ID',
client_secret: 'YOUR CLIENT SECRET',
subscription_id: 'YOUR SUBSCRIPTION ID',
credentials: credentials
}You can set the (above) values using a combination of environment variables and options hash. The values mentioned in the options hash will take precedence over the environment variables.
With 0.15.0 of Azure SDK, multiple API versions and profiles are introduced. With these changes, each individual gem has multiple versions of the services and several profiles. The azure_sdk rollup gem also consists of several profiles. The following section provides details on the usage of multiple API versions and profiles.
Versions 0.14.0 and older, would have access to the latest versions of Azure services at the time of release. Each release up to 0.14.0, would include the latest available api-version of the services. There wasn't an option to use an older api-version of the service (except for using an older version of the sdk gem). With the introduction of multiple API versions per gem, any api-version available for the service can be explicitly targeted.
A profile is a combination of different resource types with different versions from different services. Using a profile, will help you mix and match between various resource types.
If you would like to use the latest versions of all the services, then the recommendation is to use the Latest profile of the Azure SDK rollup gem.
If you would like to use the services compatible with the Azure Stack, then the recommendation is to use the V2017_03_09 profile of the Azure SDK rollup gem.
If you would like to use the latest api-version of a service, then the recommendation is to use the Latest profile of the specific gem. For example, if you would like to use the latest api-version of compute service alone, use the Latest profile of compute gem.
If you would like to use specific api-version of a service, then the recommendation is to use the specific API versions defined inside that gem.
Note: All the above options could be combined within the same application.
azure_sdk gem is a rollup of all the supported gems in the Ruby SDK. This gem consists of a Latest profile which supports the latest version of all services. it introduces a versioned profile V2017_03_09 profile which is b
No open issues yet, or sync has not completed.