1.2.0 • Published 5 years ago
azure-arm-keyvault v1.2.0
Microsoft Azure SDK for Node.js - Key Vault Management
This project provides a Node.js package for managing vaults on Azure Key Vault. Right now it supports:
- Node.js version: 6.x.x or higher
- REST API version: 2015-06-01
Features
- Manage vaults: create, update, delete, list and get.
How to Install
npm install azure-arm-keyvault
Detailed Sample
A sample that can be cloned and run can be found here.
How to Use
The following example creates a new vault.
const msRestAzure = require('ms-rest-azure');
const KeyVaultManagementClient = require('azure-arm-keyvault');
// Interactive Login
const client;
msRestAzure.interactiveLogin().then((credentials) => {
client = new KeyVaultManagementClient(credentials, '<your-subscription-id>');
return client.vaults.list();
}).then((vaults) => {
console.dir(vaults, {depth: null, colors: true});
return;
}).then(() => {
let resourceGroup = '<resource group name>';
let vaultName = 'myNewVault';
let parameters = {
location : "East US",
properties : {
sku : {
family : 'A',
name : 'standard'
},
accessPolicies : [],
enabledForDeployment : false,
tenantId : '<tenant GUID>'
},
tags : {}
};
console.info('Creating vault...');
return client.vaults.createOrUpdate(resourceGroup, vaultName, parameters);
}).then((vault) => {
console.dir(vault, {depth: null, colors: true});
return;
}).catch((err) => {
console.log('An error occured');
console.dir(err, {depth: null, colors: true});
return;
});
Related projects
1.2.0
5 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.2-preview
6 years ago
1.1.1-preview
6 years ago
1.1.0-preview
7 years ago
1.0.0-preview
7 years ago
0.11.4
8 years ago
0.11.3
8 years ago
0.11.2
8 years ago
0.11.1
8 years ago
0.11.0
8 years ago
0.10.1
9 years ago
0.10.0
9 years ago