# Key Vault This document explains how to get started using Azure Key Vault Service with Fog to manage Vault. With this gem you can create, list or delete Vault. ## Usage First of all, you need to require the Fog library by executing: ```ruby require 'fog/azurerm' ``` ## Create Connection Next, create a connection to the Key Vault Service: ```ruby fog_key_vault_service = Fog::KeyVault::AzureRM.new( tenant_id: '', # Tenant Id of Azure Active Directory Application client_id: '', # Client Id of Azure Active Directory Application client_secret: '', # Client Secret of Azure Active Directory Application subscription_id: '' # Subscription Id of an Azure Account ) ``` ## Check Vault Existence ```ruby fog_key_vault_service.vaults.check_vault_exists('', '') ``` ## Create Vault Create a new Vault. ```ruby vault = fog_key_vault_service.vaults.create( name: '', location: '', resource_group: '', tenant_id: '', sku_family: '', sku_name: '', access_policies: [ { tenant_id: '', object_id: '', permissions: { keys: [''], secrets: [''] } } ], tags: { key: 'value' # [Optional] } ) ``` ## List Vaults List all vaults in a resource group ```ruby vaults = fog_key_vault_service.vaults(resource_group: '') vaults.each do |vault| puts "#{vault.name}" end ``` ## Retrieve a single Vault Get a single record of Vault ```ruby vault = fog_key_vault_service .vaults .get('', '') puts "#{vault.name}" ``` ## Destroy a single Vault Get a vault object from the get method and then destroy that vault. ```ruby vault.destroy ``` ## Support and Feedback Your feedback is highly appreciated! If you have specific issues with the fog ARM, you should file an issue via Github.