Microsoft Azure SDK for Node.js - Graph Management
This project provides a Node.js package that makes it easy to manage MicrosoftGraph Resources. Right now it supports:
- Node.js version: 6.x.x or higher
How to Install
npm install azure-graph
How to use
Authentication, client creation and listing users as an example
Interactive Login
var msRestAzure = ;var graphRbacManagementClient = ; // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, // the user will get a DeviceTokenCredentials object. //Note: You need to explicitly specify the tokenAudience as graph and the your domain (tenantId) in which the AD Graph exists. // This needs to be done only for working graph clients. For other ARM clients specifying this information is not required.var tenantId='abcd-efgh-ijk-lmno-12345';// Enter your tenant ID here which can be found from your Azure AD URL// Eg. https://manage.windowsazure.com/example.com#Workspaces/ActiveDirectoryExtension/Directory/<TenantId>/users msRestAzure;
Login with username and password (organizational accounts)
var msRestAzure = ; var graphRbacManagementClient = ; var tenantId='abcd-efgh-ijk-lmno-12345'; // Enter your tenant ID here which can be found from your Azure AD URL // Eg. https://manage.windowsazure.com/example.com#Workspaces/ActiveDirectoryExtension/Directory/<TenantId>/users msRestAzure;
Login with serviceprincipal and secret
var msRestAzure = ; var graphRbacManagementClient = ; var tenantId='abcd-efgh-ijk-lmno-12345'; // Enter your tenant ID here which can be found from your Azure AD URL // Eg. https://manage.windowsazure.com/example.com#Workspaces/ActiveDirectoryExtension/Directory/<TenantId>/users msRestAzure;