Détail du package

ms-rest-azure

Azure1.1mMIT3.0.2

Client Runtime for Node.js Azure client libraries generated using AutoRest

node, microsoft, autorest, azure

readme

Announcing the new Azure SDK for JavaScript

We are excited to announce that we are building a new Azure SDK for JavaScript in a new GitHub repo located here: https://github.com/azure/azure-sdk-for-js.
These packages ship with TypeScript type definitions and have both Node.js and Browser support.

Below are key points regarding deprecation of the packages in this repo and migration to the new packages

  • All of the management plane SDKs (azure-arm-*) and all of the data plane SDKs (azure-*), along with the rollup package azure in this repository, have been deprecated as of March 2023. They have been replaced by the Azure SDK for JavaScript packages.
  • All of the management plane SDKs for the V1 Azure API (Azure Service Management) azure-asm-* will continue to be maintained from the Azure SDK for Node.js repository. We expect customers using these packages to move to Azure Resource Manager API packages at their earliest convenience.
  • To migrate your code from Azure SDK for Node.js to the new Azure SDK for JavaScript, first identify the counterparts in the new SDK and then read our Migration from Node.js packages (azure-sdk-for-node) to JavaScript packages (azure-sdk-for-js) article.

Azure SDK for Node.js

NOTE: This repo is deprecated. All future JavaScript SDKs have moved to Azure SDK for JavaScript. Please see the note above for more information.

This project provides Node.js packages that makes it easy to consume and manage Microsoft Azure Services.

If you are new to Azure and Node.js, see Azure for Node.js developers.

For documentation specific to the Azure SDK Node.js packages, see the Azure Node SDK Reference.

Component Build Status
Management Libraries Build Status
Client Libraries Build Status

Usage

To install an individual Node.js package, look up the package name and use npm to install it into your project.

For example to install the Storage package, you would run:

$ npm install azure-storage

Supported services

This SDK has support for:

  • Azure services
    • These are packages with the naming convention of azure-<servicename>.
    • In the new Azure SDK for JS, the counterparts will have the naming convention of @azure/<servicename>
  • ARM services
    • These are packages with the naming convention of azure-arm-*
    • In the new Azure SDK for JS, the counterparts will have the naming convention of @azure/arm-*
  • Legacy ASM services
    • These are packages with the naming convention of azure-asm-*
    • In the new Azure SDK for JS, there are no counterparts to these packages. Please use the ARM services via packages with the naming convention of @azure/arm-*
  • The roll up package azure
    • Installing this package will result in installing all the packages in this SDK including the helper modules like ms-rest-azure.
    • In the new Azure SDK for JS, there is no counterpart to this. You are encouraged to install only the packages you need.

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-*)
    • Older 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.

Azure service modules

Package Description Documentation
azure-gallery Access to the Azure Marketplace azure-gallery package
azure-graph Access to Azure Active Directory Azure Active Directory modules
azure-keyvault Integrate with Key Vault Azure Key Vault modules
azure-monitoring Azure Monitoring azure-monitoring package
azure-scheduler Create jobs with Azure Scheduler Azure Scheduler modules
azure-servicefabric Azure Service Fabric Azure Service Fabric modules
azure-sb Service Bus Azure Service Bus modules
azure-storage Storage Azure Storage modules
azure-batch Azure Batch processing azure-batch package

Note: If there is a Microsoft Azure service that doesn't have a package yet, open an issue so that we may prioritize it in the backlog.

Azure Resource Management (ARM)

Service Install Command
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
Batch AI 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
Data Lake Analytics npm install azure-arm-datalake-analytics
Data Lake 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
StorSimple 8000 series 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
Visual Studio npm install azure-arm-visualstudio
WebApps (WebSites) npm install azure-arm-website

Azure Service Management (ASM)

Service Install Command
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

Library Install Command
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?

Related Projects

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

This project has adopted the Microsoft Open Source Code of Conduct.

For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Open Source Guidelines.

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

Impressions

changelog

3.0.1 (11/10/2021)

  • Change the dependencies of adal-node from 0.1.28 to 0.2.2. for issue issue #5215
  • Remove unused dependency on moment. For issue issue #5157

3.0.0 (07/11/2019)

  • Remove leading dot from azure environment settings. This fixes issue #4706 via the PR 5101

2.6.0 (01/09/2019)

  • Add support for custom MSI endpoint & api version when creating MSIVmTokenCredentials. This fixes issue #2836 via the PR 4528

2.5.9 (09/26/2018)

  • Add request as a dependency since MSIVmTokenCredentials and MSIAppServiceTokenCredentials use it directly.
  • Update ms-rest version dependency to 2.3.7

2.5.7 (06/12/2018)

  • Added validateAuthority to AzureEnvironment type definitions

2.5.6 (06/12/2018)

  • Updated vulnerable dependencies

2.5.5 (03/12/2018)

  • Added an interface TokenResponse that extends adal.TokenResponse. This interface would be the return type of getToken() method on the credential classes.
  • Added getToken() method on DeviceTokenCredentials to make it consistent with other credential classes.
  • Improved the parsing logic for MSITokenCredentials there by standardizing the property names of the TokenResponse that is received from MSI or adal (sp, interactive, user) authentication.
  • Ensured tokenAudience option is used when provided, while acquiring the userCode and token with deviceCode in interactive login.

2.5.4 (02/22/2018)

  • Moved RpRegistrationFilter from ms-rest-azure to ms-rest. This fixes #2367.

2.5.3 (01/31/2018)

  • Opened up the optional parameter tokenAudience for several login methods to accept 'graph', 'batch' or any other resource uri like 'https://vault.azure.net/'.
  • Added batchResourceId in all the supported AzureEnvironments.

2.5.2 (01/31/2018)

  • Migrated KeyVaultCredentials from keyvault data-plane and added support for various auth consumption.

2.5.1 (01/30/2018)

  • Added support for EventGrid TopicCredentials object.

2.5.0 (12/28/2017)

  • Convert underscore_seperated properties in MSI tokenResponses to CamelCase.

2.4.5 (11/17/2017)

  • Added innererror field to CloudError class. #2328

2.4.4 (11/07/2017)

  • Fixed a bug in the request url creation for AppService MSI.

2.4.3 (11/07/2017)

  • Fixed a bug (about initializing the resource property in MSITokenCrentials class) in the index.d.ts file.

2.4.2 (11/06/2017)

  • Relaxed check for the value of provisioningState property by making it case insensitive.
  • Updated the activeDirectoryEndpointUrl for the AzureUSGovernment Azure Environment from login-us.microsoftonline.com to login.microsoftonline.us
  • Added support for CognitiveServicesCredentials.
  • Added support for MSIAppServiceTokenCredentials and loginWithAppServiceMSI() #2292.

2.4.1 (10/11/2017)

  • Restricted dependency on "moment" from "^2.18.1" to "~2.18.1" due to bugs in 2.19.0

2.4.0 (10/03/2017)

  • Bug fix: Renamed loginwithAuthFile to loginWithAuthFile.

2.3.5 (09/29/2017)

  • Added retry logic for interactiveLogin if 'authorization_pending' error is received as pointed in issue #2002.

2.3.4 (09/29/2017)

  • Updated version of dependencies like async, uuid and moment.

2.3.3 (09/22/2017)

  • With latest changes in the service code, domain is no more a required parameter for MSITokenCredentials.

2.3.2 (09/21/2017)

  • Fixed bugs in index.d.ts related to MSITokenCredentials and loginWithMSI method
  • Fixed bugs in the MSITokenCredentials class

2.3.1 (09/11/2017)

  • Fixed endpoint information for Azure environments
  • Added typings for authfile and msi auth

2.3.0 (08/25/2017)

  • Added support to authenticate using service principal from auth file. #2225
  • Added support for polling PATCH operation with 201 initial response.
  • Added support for authenticating via MSI on an Azure VM with managed identity #2224
  • Fixed issues #2245, #2247

2.2.3 (7/14/2017)

  • Hot fix for RP Registration Filter for new subscription scenario.
  • Return the original response with 409 status code if auto RP registration failed.

2.2.1 (6/29/2017)

  • Updated AzureServiceClientOptions type definitions.
  • Updated dependency of ms-rest to ^2.2.1.

2.2.0 (6/23/2017)

  • Added support for automatic RP registration by adding a filter in the request pipeline.

2.1.2 (4/29/2017)

  • Updated minimum dependency on "ms-rest" to "^2.2.0" to ensure the new fixes in ms-rest are consumed.

2.1.1 (4/14/2017)

  • Updated minimum dependency on "ms-rest" to "^2.1.0" to ensure the new fixes in ms-rest are consumed.

2.1.0 (4/5/2017)

  • Removed the dependency on azure-arm-resource and made subscription client local to ms-rest-azure
  • Added WithAuthResponse flavor login methods so that the user can get credentials and subscriptions when the Promise is resolved. These flavors look as follows:
    function interactiveLoginWithAuthResponse(options?: InteractiveLoginOptions): Promise<AuthResponse>;
    function loginWithServicePrincipalSecretWithAuthResponse(clientId: string, secret: string, domain: string, options?: AzureTokenCredentialsOptions): Promise<AuthResponse>;
    function loginWithUsernamePasswordWithAuthResponse(username: string, password: string, options?: LoginWithUsernamePasswordOptions): Promise<AuthResponse>;
    where AuthResponse looks like this:
    export interface AuthResponse {
    credentials: DeviceTokenCredentials | ApplicationTokenCredentials | UserTokenCredentials;
    subscriptions: Array<LinkedSubscription>;
    }
  • Note: Moving forward, the login functionality will be moved out of ms-rest-azure into a different package. This needs to be done for us to move towards supporting an isomorphic javascript library.

2.0.1 (4/3/2017)

  • Updated the azure-arm-resource dependency to "^2.0.0-preview".

2.0.0 (3/28/2017)

  • Minimum required node.js version is 6.10
  • Added support for generic request and generic long running operation request
  • Added support for sending ms-rest and ms-rest-azure versions in the user-agent header for telemetry
  • Added Promise support and made callback as an optional last parameter to the signature of the exposed methods in the runtime.
  • Moved to ES6 syntax.
  • Updated type definition (.d.ts) files that are compatible with 2.2.1 version of TypeScript.