Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

azure

azure55.2k(MIT OR Apache-2.0)deprecated2.3.1-previewTypeScript support: definitely-typed

Superceded by the Azure SDK for JS; details https://github.com/azure/azure-sdk-for-node#announcing-the-new-azure-sdk-for-javascript

Microsoft Azure Client Library for node

node, azure

readme

Azure SDK for Node.js

NPM version Build Status

This project provides a Node.js package that makes it easy to consume and manage Microsoft Azure Services. It supports sdks for:

  • old ASM services (packages with the naming convention of azure-asm-*)
  • new ARM services (packages with the naming convention of azure-arm-*)
  • data plane of some Azure services (packages with the naming convention of azure-<servicename>).

Usage

This module includes all of the individual Azure Node.js modules in a single place. If your application only needs access to specific management modules, see the list of individual modules below.

$ npm install azure

This will allow you access to some helper methods as well as all of the individual modules. For example, by installing the azure module, you can directly require and use the ms-rest-azure common module. This organization method allows for submodules (and peer dependent modules) to always be in sync with each other.

Note: We haven't provided fine-grained modules for every supported Microsoft Azure service yet. This will come soon. If there is a module that you find is missing, open an issue so that we may prioritize it in the backlog.

Documentation

Documentation of the supported sdks can be found at two places:

  • https://azure.github.io/azure-sdk-for-node - This website primarily provides sdk documentation for
    • ASM based services (azure-asm-*)
    • some old data plane sdks like azure-sb, azure-scheduler, azure-storage-legacy, azure-monitoring, etc.
    • runtime sdks like ms-rest, ms-rest-azure, azure-common
  • https://aka.ms/azure-node-sdk - This website primarily provides sdk documentation for
    • ARM based services (azure-arm-*)
    • newer data plane sdks like azure-batch, azure-graph, etc.

Authenticating

There are three ways to authenticate against Azure while using the management plane (azure-arm-*) sdks and the azure-graph sdk, use this guide to determine which method to use.

AzureNodeEssentials VSCode extension

The AzureNodeEssentials extension helps you easily interact with Azure. It helps you:

  • create a project scaffolding
  • install correct dependencies
  • ready to use snippets for authentication and deploying templates to azure

Please feel free to provide feedback for the extension by opening github issues over here.

Install individual modules

Azure Service (Data plane) Install Command
Gallery npm install azure-gallery
Graph npm install azure-graph
Key Vault npm install azure-keyvault
Monitoring npm install azure-monitoring
Scheduler npm install azure-scheduler
Service Fabric npm install azure-servicefabric
Service Bus npm install azure-sb
Storage npm install azure-storage
Batch npm install azure-batch
Azure Resource Management (ARM) (Control plane)
Advisor npm install azure-arm-advisor
Api Management npm install azure-arm-apimanagement
App Insights npm install azure-arm-appinsights
Automation npm install azure-arm-automation
Authorization npm install azure-arm-authorization
Batch npm install azure-arm-batch
BatchAI npm install azure-arm-batchai
Billing npm install azure-arm-billing
CDN npm install azure-arm-cdn
CognitiveServices npm install azure-arm-cognitiveservices
ContainerInstance npm install azure-arm-containerinstance
CosmosDB npm install azure-arm-cosmosdb
Commerce/Usage npm install azure-arm-commerce
Container Registry npm install azure-arm-containerregistry
CustomerInsights npm install azure-arm-customerinsights
Compute npm install azure-arm-compute
Datafactory npm install azure-arm-datafactory
Datalake Analytics npm install azure-arm-datalake-analytics
Datalake Store npm install azure-arm-datalake-store
DevTest Labs npm install azure-arm-devtestlabs
DNS npm install azure-arm-dns
DomainServices npm install azure-arm-domainservices
EventGrid npm install azure-arm-eventgrid
EventHubs npm install azure-arm-eventhub
HDInsight npm install azure-arm-hdinsight
HDInsightJobs npm install azure-arm-hdinsight-jobs
Insights npm install azure-arm-insights
IotHub npm install azure-arm-iothub
Key Vault npm install azure-arm-keyvault
Logic Apps npm install azure-arm-logic
Machine Learning npm install azure-arm-machinelearning
Machine Learning Compute npm install azure-arm-machinelearningcompute
Media Services npm install azure-arm-mediaservices
Mobile Engagement npm install azure-arm-mobileengagement
Monitor Management npm install azure-arm-monitor
Notification Hubs npm install azure-arm-notificationhubs
Operations Management npm install azure-arm-operations
Operational Insights npm install azure-arm-operationalinsights
PowerBi Embedded npm install azure-arm-powerbiembedded
RecoveryServices npm install azure-arm-recoveryservices
RecoveryServices Backup npm install azure-arm-recoveryservicesbackup
RecoveryServices SiteRecovery npm install azure-arm-recoveryservices-siterecovery
Redis Cache npm install azure-arm-rediscache
Relay npm install azure-arm-relay
Resource Health npm install azure-arm-resourcehealth
Resource Manager npm install azure-arm-resource
Scheduler npm install azure-arm-scheduler
Search npm install azure-arm-search
ServerManagement npm install azure-arm-servermanagement
Servicebus npm install azure-arm-sb
Service Fabric npm install azure-arm-servicefabric
Storage npm install azure-arm-storage
Storage Import-Export npm install azure-arm-storageimportexport
Storsimple8000series npm install azure-arm-storsimple8000series
Stream Analytics npm install azure-arm-streamanalytics
Sql npm install azure-arm-sql
Traffic Manager npm install azure-arm-trafficmanager
Virtual Networks npm install azure-arm-network
VisualStudio npm install azure-arm-visualstudio
WebApps (WebSites) npm install azure-arm-website
Azure Service Management (ASM) (Control plane)
Compute npm install azure-asm-compute
HDInsight npm install azure-asm-hdinsight
Service Bus npm install azure-asm-sb
Service Manager npm install azure-asm-mgmt
Store npm install azure-asm-store
Scheduler npm install azure-asm-scheduler
SQL Database npm install azure-asm-sql
Storage npm install azure-asm-storage
Subscriptions npm install azure-asm-subscription
Traffic Manager npm install azure-asm-trafficmanager
Virtual Networks npm install azure-asm-network
WebSites npm install azure-asm-website
Base Libraries
Common Functionality (for ASM & ARM clients) npm install azure-common
Common Functionality for ARM clients generated from Autorest (Generic) npm install ms-rest
Common Functionality for ARM clients generated from Autorest (Azure) npm install ms-rest-azure

Need Help?

License

This project is licensed under MIT and Apache-2.0.

  • "MIT" license is usually used for the client libraries generated using Autorest that are targeting ARM (V2 version of Azure REST API). The license can be found in "LICENSE.MIT.txt" file in this repository.
  • "Apache-2.0" license is usually used for the client libraries generated using an internal code generator that are targeting ASM (V1 version of Azure REST API). The license can be found in "LICENSE.Apache.txt" file in this repository.

Contribute

Getting Started Developing

Want to get started hacking on the code, super! Follow the following instructions to get up and running. These instructions expect you have Git and a supported version of Node installed.

  1. Fork it
  2. Git Clone your fork (git clone {your repo})
  3. Move into sdk directory (cd azure-sdk-for-node)
  4. Install all dependencies (npm install)
  5. Run the tests (npm test). You should see all tests passing.

Contributing Code to the Project

You found something you'd like to change, great! Please submit a pull request and we'll do our best to work with you to get your code included into the project.

  1. Commit your changes (git commit -am 'Add some feature')
  2. Push to the branch (git push origin my-new-feature)
  3. Create new Pull Request

changelog

2018.06.24 version 2.3.1-preview

  • Added client library for Log Analytics

2018.06.12 version 2.3.0-preview

  • Updated dependencies based on npm audit warnings
  • Removed deprecated azure-monitor from azure package

2017.10.11 version 2.2.1-preview

  • Restricting dependency on "moment" from "^2.18.1" to "~2.18.1" due to bugs in 2.19.0. Updated packages are:
    • azure
    • azure-batch
    • azure-monitor
    • azure-arm-monitor
    • azure-asm-website
    • ms-rest
    • ms-rest-azure

2017.09.29 version 2.2.0-preview

2017.04.03 version 2.0.0-preview

2016.09.07 Version 1.2.0-preview

  • Added client libraries for following ARM services
    • Servicebus management
    • Trafficmanager
    • Powerbiembedded
    • Eventhub management
    • IotHub Management
  • Regenerated following services with the latest (api-version) swagger spec
    • KeyVaultManagement and KeyVault data plane
    • ResourceManagement
    • DevTestLabs
    • NotificationHubManagement
    • Commerce
  • Removed ApiAppManagement library as the service is no longer deployed on Azure
  • Updated the rollup file (lib/azure.js) to be in sync with the latest changes
  • Updated License Info
    • All the Autorest generated client libraries are under MIT license
    • All the old codegenerator generated client libraries are under Apache-2.0
  • Bumped up the request library to 2.74.0

2015.03.25 Version 0.10.5

  • Used newer 'request' package version of '2.45.0'
  • Updated website client lib to accept status code of 200 on 'createPublishingUser'
  • Updated compute client readme file

2015.02.09 Version 0.10.4

  • regenerate client lib code for the latest service api

2015.01.21 Version 0.10.3

  • Added option to overwrite the http agent
  • Minor script fixes

2014.12.02 Version 0.10.2

  • Documentation link fixes for servicebus management client
  • Fixed CertificateCloudCredentials to accept the pem as buffer or string
  • Updated travis.yml
  • Updated null and undefined check for several attributes in separate modules

2014.11.07 Version 0.10.1

  • Fixed parsing of sql db error messages with xml namespace
  • Implemented Renew-Lock for Message in ServiceBus

2014.10.02 Version 0.10.0

  • Switch to use "azure-storage" from "azure-storage-legacy"
  • Fix retry logic on http status code 408

2014.09.10 Version 0.9.16

  • Release new azure authorization clients
  • Release new subscription client of azure resource management
  • Better odata error parsing in azure common package

2014.08.12 Version 0.9.15

  • Fixed dependencies in the azure-sb module

2014.08.11 Version 0.9.14

  • Bug fixes to notification hub client
  • Updated repo pointers in package.json files

2014.07.30 Version 0.9.13

  • Updates to service management clients
  • Fixes to notification hub client
  • Separated out service bus, and hdinsight management into separate modules
  • Obsolete service management APIs removed

2014.07.02 Version 0.9.11

  • Updated service management clients

2014.06.23 Version 0.9.10

  • Bug fix for url filter creation

2014.06.19 Version 0.9.9

  • ARM website wrappers
  • Various bug fixes in management packages
  • Helper constructor for resource identifiers

2014.06.03 Version 0.9.8

  • Fix for blob streaming
  • Split out storage into azure-storage-legacy module
  • fix for apns notification hub payload format
  • updated all service clients to support overriding timeouts
  • Test suite fixes

2014.05.02 Version 0.9.7

  • Updated all service clients with codegen fixes
  • Exposing some cert management functions from azure-common

2014.04.29 Version 0.9.6

  • Fixing missing dependencies in submodules

2014.04.29 Version 0.9.5

  • Turning on monitoring and scheduler features in rollup package
  • Fixing references to monitoring client in azure.js

2014.04.29 Version 0.9.4

  • Added Monitoring and Scheduler clients
  • Regeneration / update of all management clients
  • Trimming extra spaces in urls
  • Added "skipEncoding" option when writing blobs
  • Returning status codes on management library errors

2014.01.30 Version 0.8.1

  • Added web jobs APIs
  • Support for expiration in template messages in Notification Hubs

2014.01.15 Version 0.8.0

  • Added the Preview Service Management libraries as separate modules
  • Added ability to consume PEM files directly from the Service Management libraries
  • Added support for createOrUpdate and createRegistrationId in the Notification Hubs libraries

2014.01.10 Version 0.7.19

  • Lock validator version

2013.11.27 Version 0.7.18

  • Lock xmlbuilder version

2013.11.5 Version 0.7.17

  • Added getBlob and createBlob operations that support stream piping
  • Added compute, management, network, serviceBus, sql, storage management, store and subscription preview wrappers
  • Multiple bugfixes

2013.10.16 Version 0.7.16

  • Improved API documentation
  • Updated Virtual Machines API to 2013-06-01
  • Added website management preview wrappers
  • Multiple bugfixes

2013.08.19 Version 0.7.15

  • Multiple storage fixes
  • Fix issue with Notification Hubs template message sending

2013.08.12 Version 0.7.14

  • Multiple storage fixes
  • Documentation improvements
  • Added support for large blobs upload / download

2013.08.08 Version 0.7.13

  • Lock request version

2013.07.29 Version 0.7.12

  • Added MPNS support
  • Added Service management vnet operations support

2013.07.10 Version 0.7.11

  • Hooked up new configuration system to storage APIs
  • Support for AZURE_STORAGE_CONNECTION_STRING environment variable
  • Included API for websites management
  • Fixed UTF-8 support in table batch submit

2013.06.26 Version 0.7.10

  • Various fixes in storage APIs

2013.06.19 Version 0.7.9

  • First part of new SDK configuration system
  • Support for AZURE_SERVICEBUS_CONNECTION_STRING environment variable
  • Updated SAS generation logic to include version number
  • Infrastructure support for creating passwordless VMs

2013.06.13 Version 0.7.8

  • Updates to HDInsight operations

2013.06.06 Version 0.7.7

  • Added support for Android notification through Service Bus Notification Hubs
  • Support prefixes when listing tables
  • Support '$logs' as a valid blob container name to support reading diagnostic information
  • Fix for network configuration serialization for subnets

2013.05.30 Version 0.7.6

  • Added list, delete and create cluster operations for HD Insight.

2013.05.15 Version 0.7.5

  • Fixed registration hubs issue with requiring access key when shared key was provided.
  • Fixed registration hubs issue with listByTag, Channel and device token

2013.05.09 Version 0.7.4

  • Fixed encoding issue with partition and row keys in table storage query

2013.05.01 Version 0.7.3

  • Fixed issue #680: BlobService.getBlobUrl puts permissions in sas url even if not given
  • Changes to test suite & sdk to run in other environments
  • Notification hubs registrations
  • Support in ServiceManagementClient for role reboot and reimage

2013.04.05 Version 0.7.2

  • Removing workaround for SSL issue and forcing node version to be outside the > 0.8 && < 0.10.3 range where the issue occurs

2013.04.03 Version 0.7.1

  • Adding (limited) support for node 0.10
  • Fixing issue regarding registering providers when using websites or mobiles services

2013.03.25 Version 0.7.0

  • Breaking change: Primitive types will be stored for table storage.
  • Adding support for creating and deleting affinity groups
  • Replacing http-mock by nock and making all tests use it by default
  • Adding notification hubs messages for WNS and APNS
  • Add Strict SSL validation for server certificates
  • Add support for creating subscriptions that expire

2013.03.12 Version 0.6.11

  • Added constraint to package.json to restrict to node versions < 0.9.

2013.02.11 Version 0.6.10

  • Added helper date.* functions for generating SAS expirations (secondsFromNow, minutesFromNow, hoursFromNow, daysFromNow)
  • Added SQL classes for managing SQL Servers, Databases and Firewall rules
  • Updating to use latest xml2js

2012.12.12 Version 0.6.9

  • Exporting WebResource, Client classes from package to support CLI.
  • Install message updated to remind users the CLI is now a separate package.

2012.11.20 Version 0.6.8

  • CLI functionality has been pulled out into a new "azure-cli" module. See https://github.com/Azure/azure-xplat-cli for details.
  • Add support for sb: in ServiceBus connection strings.
  • Add functions to ServiceManagement for managing storage accounts.
  • Merged #314 from @smarx for allowing empty partition keys on the client.
  • Merged #447 from @anodejs for array enumeration and exception on batch response.
  • Various other fixes

2012.10.15 Version 0.6.7

  • Adding connection strings support for storage and service bus
  • Fixing issue with EMULATED and explicit variables making the later more relevant
  • Adding Github support
  • Adding website application settings support

2012.10.12 Version 0.6.6

  • Using fixed version of commander.js to avoid bug in commander.js 1.0.5

2012.10.01 Version 0.6.5

  • Bugfixing

2012.09.18 Version 0.6.4

  • Multiple Bugfixes around blob streaming

2012.09.09 Version 0.6.3

  • Fixing issue with xml2js

2012.08.15 Version 0.6.2

  • Multiple Bugfixes

2012.07.02 Version 0.6.1

  • Multiple Bugfixes
  • Adding subscription setting and listing functionality.

2012.06.06 Version 0.6.0

  • Adding CLI tool
  • Multiple Bugfixes

2012.04.19 Version 0.5.3

  • Service Runtime Wrappers
  • Multiple Bugfixes
  • Unit tests converted to mocha and code coverage made easy through JSCoverage

2012.02.10 Version 0.5.2

  • Service Bus Wrappers
  • Storage Services UT run against a mock server.
  • Node.exe version requirement lowered to raise compatibility.
  • Multiple Bugfixes

2011.12.14 Version 0.5.1

  • Multiple bug fixes

2011.12.09 Version 0.5.0

  • Initial Release