# 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/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 azure_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 azure_key_vault_service.vaults.check_vault_exists(, ) ``` ## Create Vault Create a new Vault. ```ruby vault = azure_key_vault_service.vaults.create( name: '', location: 'eastus', resource_group: '', tenant_id: , sku_family: 'A', sku_name: 'standard', access_policies: [ { tenant_id: , object_id: , permissions: { keys: ['all'], secrets: ['all'] } } ] ) ``` ## List Vaults List all vaults in a resource group ```ruby vaults = azure_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 = azure_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.