Microsoft Azure SDK for Node.js - Resource Management
This project provides a Node.js package that makes it easy to manage Azure resources. Right now it supports:
- Node.js version: 6.x.x or higher
How to Install
npm install azure-arm-resource
How to Use
Authentication, client creation and listing resources as an example
var msRestAzure = ;var resourceManagement = ; // Interactive LoginmsRestAzure;
Creating a Resource Group
var util = ;var groupParameters = location: 'West US' tags: tag1: 'val1' tag2: 'val2' ;var groupName = 'testGroup1';clientresourceGroups;
Create a Generic Resource in a Resource Group
var groupName = 'testGroup1';var resourceName = 'autorestsite102';var params = 'location': 'West US' 'properties' : 'SiteMode': 'Limited' 'ComputeMode': 'Shared' 'Name': resourceName ;var resourceType = 'sites';var parentResourcePath = '';var resourceProviderNamespace = 'Microsoft.Web';var apiVersion = '2014-04-01';clientresources;
Get a Generic Resource in a Resource Group
var groupName = 'testGroup1';var resourceName = 'autorestsite102';var resourceType = 'sites';var parentResourcePath = '';var resourceProviderNamespace = 'Microsoft.Web';var apiVersion = '2014-04-01';clientresources;
Listing all resources in your subscription
clientresources;
Deleting a Generic Resource in a Resource Group
var groupName = 'testGroup1';var resourceName = 'autorestsite102';var resourceType = 'sites';var parentResourcePath = '';var resourceProviderNamespace = 'Microsoft.Web';var apiVersion = '2014-04-01';clientresources;
Deleting the Resource Group
var groupName = 'testGroup1';clientresourceGroups;
Please take a look at the tests over here for more examples.