Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

azure-arm-resource

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-arm-resource

Microsoft Azure Resource Management Client Library for node

  • 3.0.0-preview
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
175K
decreased by-22.71%
Maintainers
1
Weekly downloads
 
Created

What is azure-arm-resource?

The azure-arm-resource npm package is a client library for managing Azure resources. It provides functionalities to interact with Azure Resource Manager (ARM) APIs, allowing you to create, update, delete, and manage Azure resources programmatically.

What are azure-arm-resource's main functionalities?

Create Resource Group

This code sample demonstrates how to create a new resource group in Azure using the azure-arm-resource package. It logs in using a service principal and then creates a resource group in the specified location.

const msRestAzure = require('ms-rest-azure');
const ResourceManagementClient = require('azure-arm-resource').ResourceManagementClient;

msRestAzure.loginWithServicePrincipalSecret(clientId, secret, domain, (err, credentials) => {
  if (err) throw err;
  const client = new ResourceManagementClient(credentials, subscriptionId);
  const groupParameters = { location: 'westus' };
  client.resourceGroups.createOrUpdate('myResourceGroup', groupParameters, (err, result) => {
    if (err) throw err;
    console.log('Resource group created:', result);
  });
});

List Resource Groups

This code sample demonstrates how to list all resource groups in a subscription using the azure-arm-resource package. It logs in using a service principal and then retrieves and prints the list of resource groups.

const msRestAzure = require('ms-rest-azure');
const ResourceManagementClient = require('azure-arm-resource').ResourceManagementClient;

msRestAzure.loginWithServicePrincipalSecret(clientId, secret, domain, (err, credentials) => {
  if (err) throw err;
  const client = new ResourceManagementClient(credentials, subscriptionId);
  client.resourceGroups.list((err, result) => {
    if (err) throw err;
    console.log('List of resource groups:', result);
  });
});

Delete Resource Group

This code sample demonstrates how to delete a resource group in Azure using the azure-arm-resource package. It logs in using a service principal and then deletes the specified resource group.

const msRestAzure = require('ms-rest-azure');
const ResourceManagementClient = require('azure-arm-resource').ResourceManagementClient;

msRestAzure.loginWithServicePrincipalSecret(clientId, secret, domain, (err, credentials) => {
  if (err) throw err;
  const client = new ResourceManagementClient(credentials, subscriptionId);
  client.resourceGroups.deleteMethod('myResourceGroup', (err, result) => {
    if (err) throw err;
    console.log('Resource group deleted:', result);
  });
});

Other packages similar to azure-arm-resource

Keywords

FAQs

Package last updated on 28 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc