Git Product home page Git Product logo

azure / azure-sdk-for-js Goto Github PK

View Code? Open in Web Editor NEW
1.9K 294.0 1.1K 408.76 MB

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.

License: MIT License

TypeScript 86.06% JavaScript 13.58% PowerShell 0.32% HTML 0.01% CSS 0.01% Batchfile 0.01% Dockerfile 0.01% Shell 0.01% Handlebars 0.01% Bicep 0.01% Mustache 0.01% SCSS 0.01% Vue 0.01% Q# 0.01%
typescript javascript nodejs browser azure-sdk azure hacktoberfest

azure-sdk-for-js's Introduction

Azure SDK for JavaScript

Packages Dependencies DependencyGraph

This repository is for the Azure SDK for JavaScript (Node.js & Browser). It contains libraries for the breadth of Azure services. Management libraries are packages that you would use to provision and manage Azure resources. Client libraries are packages that you would use to consume these resources and interact with them.

Getting started

A few helpful resources to get started are:

  • The readme for each package contains code samples and package information. This readme can be found in the corresponding package folder under the folder of the service of your choice in the /sdk folder of this repository. The same readme file can be found on the landing page for the package in npm.
  • The API reference documentation of the latest versions of these packages, can be found at our public developer docs.
  • The API reference documentation of older versions, can be found in our versioned developer docs.

Each service might have a number of libraries available from each of the following categories:

NOTE: Some of these packages have beta versions. If you need to ensure your code is ready for production, use one of the stable, non-beta packages.

Client

Given an Azure resource already exists, you would use the client libraries to consume it and interact with it. Most of these libraries follow the Azure SDK Design Guidelines for JavaScript & TypeScript and share a number of core functionalities such as retries, logging, transport protocols, authentication protocols, etc. Others will be updated in the near future to follow the guidelines as well.

To get a list of all client libraries that follow the new guidelines, please visit our Azure SDK releases page.

Management

Management libraries enable you to provision and manage Azure resources via the Azure Resource Manager i.e. ARM. You can recognize these libraries by @azure/arm- in their package names. These are purely auto-generated based on the swagger files that represent the APIs for resource management.

Newer versions of these libraries follow the Azure SDK Design Guidelines for TypeScript. These new versions provide a number of core capabilities that are shared amongst all Azure SDKs, including the intuitive Azure Identity library, an HTTP Pipeline with custom policies, error-handling, distributed tracing, and much more. A few helpful resources to get started with these are:

NOTE: If you are experiencing authentication issues with the management libraries after upgrading certain packages, it's possible that you upgraded to the new versions of SDK without changing the authentication code, please refer to the migration guide mentioned above for proper instructions.

Need help?

Community

Try our community resources.

Reporting security issues and security bugs

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

Contributing

For details on contributing to this repository, see the contributing guide.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Impressions

azure-sdk-for-js's People

Contributors

amarzavery avatar autorestci avatar azure-sdk avatar chradek avatar colawwj avatar deyaaeldeen avatar harshanalluru avatar hectorhdzg avatar jeremymeng avatar joheredi avatar karishmaghiya avatar kazrael2119 avatar kpajdzik avatar maorleger avatar mikeharder avatar minhanh-phan avatar mpodwysocki avatar praveenkuttappan avatar qiaozha avatar ramya-rao-a avatar ramya0820 avatar richardpark-msft avatar rikkigibson avatar sadasant avatar sarangan12 avatar southpolesteve avatar timovv avatar witemple-msft avatar xiaoningliu avatar xirzec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-sdk-for-js's Issues

Fix gulp scripts type errors

Delete tsconfig.json and refresh it with npx tsc --init. Then please fix all of the type errors in gulpfile.ts and its other connected/imported files.

@azure/arm-servicefabricmesh doesn't compile properly

> @azure/[email protected] build /Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh
> tsc && rollup -c rollup.config.js && npm run minify

lib/models/replicaMappers.ts:13:3 - error TS2305: Module '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/mappers"' has no exported member 'ServiceReplicaList'.

13   ServiceReplicaList,
     ~~~~~~~~~~~~~~~~~~

lib/models/replicaMappers.ts:25:3 - error TS2305: Module '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/mappers"' has no exported member 'ContainerVolume'.

25   ContainerVolume,
     ~~~~~~~~~~~~~~~

lib/operations/replica.ts:39:147 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ReplicaListByServiceNameResponse'.

39   listByServiceName(resourceGroupName: string, applicationName: string, serviceName: string, options?: msRest.RequestOptionsBase): Promise<Models.ReplicaListByServiceNameResponse>;
                                                                                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:46:134 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ServiceReplicaList'.

46   listByServiceName(resourceGroupName: string, applicationName: string, serviceName: string, callback: msRest.ServiceCallback<Models.ServiceReplicaList>): void;
                                                                                                                                        ~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:54:170 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ServiceReplicaList'.

54   listByServiceName(resourceGroupName: string, applicationName: string, serviceName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ServiceReplicaList>): void;
                                                                                                                                                                            ~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:55:172 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ServiceReplicaList'.

55   listByServiceName(resourceGroupName: string, applicationName: string, serviceName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.ServiceReplicaList>): Promise<Models.ReplicaListByServiceNameResponse> {
                                                                                                                                                                              ~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:55:209 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ReplicaListByServiceNameResponse'.

55   listByServiceName(resourceGroupName: string, applicationName: string, serviceName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.ServiceReplicaList>): Promise<Models.ReplicaListByServiceNameResponse> {
                                                                                                                                                                                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:64:35 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ReplicaListByServiceNameResponse'.

64       callback) as Promise<Models.ReplicaListByServiceNameResponse>;
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:78:154 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ReplicaGetResponse'.

78   get(resourceGroupName: string, applicationName: string, serviceName: string, replicaName: string, options?: msRest.RequestOptionsBase): Promise<Models.ReplicaGetResponse>;
                                                                                                                                                            ~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:96:223 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ReplicaGetResponse'.

96   get(resourceGroupName: string, applicationName: string, serviceName: string, replicaName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.ServiceReplicaDescription>): Promise<Models.ReplicaGetResponse> {
                                                                                                                                                                                                                                 ~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:106:35 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ReplicaGetResponse'.

106       callback) as Promise<Models.ReplicaGetResponse>;
                                      ~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:117:100 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ReplicaListByServiceNameNextResponse'.

117   listByServiceNameNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.ReplicaListByServiceNameNextResponse>;
                                                                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:122:87 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ServiceReplicaList'.

122   listByServiceNameNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.ServiceReplicaList>): void;
                                                                                          ~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:128:123 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ServiceReplicaList'.

128   listByServiceNameNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ServiceReplicaList>): void;
                                                                                                                              ~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:129:125 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ServiceReplicaList'.

129   listByServiceNameNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.ServiceReplicaList>): Promise<Models.ReplicaListByServiceNameNextResponse> {
                                                                                                                                ~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:129:162 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ReplicaListByServiceNameNextResponse'.

129   listByServiceNameNext(nextPageLink: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.ServiceReplicaList>): Promise<Models.ReplicaListByServiceNameNextResponse> {
                                                                                                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:136:35 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/index"' has no exported member 'ReplicaListByServiceNameNextResponse'.

136       callback) as Promise<Models.ReplicaListByServiceNameNextResponse>;
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/replica.ts:148:16 - error TS2339: Property 'applicationName' does not exist on type 'typeof import("/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/parameters")'.

148     Parameters.applicationName,
                   ~~~~~~~~~~~~~~~

lib/operations/replica.ts:149:16 - error TS2339: Property 'serviceName' does not exist on type 'typeof import("/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/parameters")'.

149     Parameters.serviceName
                   ~~~~~~~~~~~

lib/operations/replica.ts:174:16 - error TS2339: Property 'applicationName' does not exist on type 'typeof import("/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/parameters")'.

174     Parameters.applicationName,
                   ~~~~~~~~~~~~~~~

lib/operations/replica.ts:175:16 - error TS2339: Property 'serviceName' does not exist on type 'typeof import("/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-servicefabricmesh/lib/models/parameters")'.

175     Parameters.serviceName,
                   ~~~~~~~~~~~

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/[email protected] build: `tsc && rollup -c rollup.config.js && npm run minify`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @azure/arm-servicefabricmesh@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kamip/.npm/_logs/2018-11-08T01_22_58_593Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/[email protected] prepack: `npm install && npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @azure/arm-servicefabricmesh@0.1.0 prepack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kamip/.npm/_logs/2018-11-08T01_22_58_618Z-debug.log

@azure/arm-webservices doesn't compile

> @azure/[email protected] prepack D:\azure-sdk-for-js\packages\@azure\arm-webservices
> npm install && npm run build

npm notice created a lockfile as package-lock.json. You should commit this file.
added 33 packages from 156 contributors and audited 55 packages in 3.261s
found 0 vulnerabilities


> @azure/[email protected] build D:\azure-sdk-for-js\packages\@azure\arm-webservices
> tsc && rollup -c rollup.config.js && npm run minify

lib/models/operationsMappers.ts:13:3 - error TS2305: Module '"D:/azure-sdk-for-js/packages/@azure/arm-webservices/lib/models/mappers"' has no exported member 'OperationEntityListResult'.

13   OperationEntityListResult,
     ~~~~~~~~~~~~~~~~~~~~~~~~~

lib/models/operationsMappers.ts:14:3 - error TS2305: Module '"D:/azure-sdk-for-js/packages/@azure/arm-webservices/lib/models/mappers"' has no exported member 'OperationEntity'.

14   OperationEntity,
     ~~~~~~~~~~~~~~~

lib/models/operationsMappers.ts:15:3 - error TS2305: Module '"D:/azure-sdk-for-js/packages/@azure/arm-webservices/lib/models/mappers"' has no exported member 'OperationDisplayInfo'.

15   OperationDisplayInfo,
     ~~~~~~~~~~~~~~~~~~~~

lib/operations/operations.ts:34:61 - error TS2694: Namespace '"D:/azure-sdk-for-js/packages/@azure/arm-webservices/lib/models/index"' has no exported member 'OperationsListResponse'.

34   list(options?: msRest.RequestOptionsBase): Promise<Models.OperationsListResponse>;
                                                               ~~~~~~~~~~~~~~~~~~~~~~

lib/operations/operations.ts:38:48 - error TS2694: Namespace '"D:/azure-sdk-for-js/packages/@azure/arm-webservices/lib/models/index"' has no exported member 'OperationEntityListResult'.

38   list(callback: msRest.ServiceCallback<Models.OperationEntityListResult>): void;
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/operations.ts:43:84 - error TS2694: Namespace '"D:/azure-sdk-for-js/packages/@azure/arm-webservices/lib/models/index"' has no exported member 'OperationEntityListResult'.

43   list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationEntityListResult>): void;
                                                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/operations.ts:44:76 - error TS2694: Namespace '"D:/azure-sdk-for-js/packages/@azure/arm-webservices/lib/models/index"' has no exported member 'OperationEntityListResult'.

44   list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationEntityListResult>, callback?: msRest.ServiceCallback<Models.OperationEntityListResult>): Promise<Models.OperationsListResponse> {
                                                                              ~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/operations.ts:44:145 - error TS2694: Namespace '"D:/azure-sdk-for-js/packages/@azure/arm-webservices/lib/models/index"' has no exported member 'OperationEntityListResult'.

44   list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationEntityListResult>, callback?: msRest.ServiceCallback<Models.OperationEntityListResult>): Promise<Models.OperationsListResponse> {
                                                                                                                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/operations.ts:44:189 - error TS2694: Namespace '"D:/azure-sdk-for-js/packages/@azure/arm-webservices/lib/models/index"' has no exported member 'OperationsListResponse'.

44   list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationEntityListResult>, callback?: msRest.ServiceCallback<Models.OperationEntityListResult>): Promise<Models.OperationsListResponse> {

~~~~~~~~~~~~~~~~~~~~~~

lib/operations/operations.ts:50:35 - error TS2694: Namespace '"D:/azure-sdk-for-js/packages/@azure/arm-webservices/lib/models/index"' has no exported member 'OperationsListResponse'.

50       callback) as Promise<Models.OperationsListResponse>;
                                     ~~~~~~~~~~~~~~~~~~~~~~

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/[email protected] build: `tsc && rollup -c rollup.config.js && npm run minify`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @azure/arm-machinelearning@0.1.0-preview build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kamip.NORTHAMERICA\AppData\Roaming\npm-cache\_logs\2018-11-08T17_27_47_622Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/[email protected] prepack: `npm install && npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @azure/arm-machinelearning@0.1.0-preview prepack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\kamip.NORTHAMERICA\AppData\Roaming\npm-cache\_logs\2018-11-08T17_27_47_693Z-debug.log

An exception if responseFilter contains > 1 value

From the api reference I see that responseFilter should contain comma-delimited list of answers to include in the response. If answer is single everything is fine (responseFilter: ['Webpages']). But if I add SpellSuggestions - I receive an error:
{"_type": "ErrorResponse", "errors": [{"_type": "Error", "code": "InsufficientAuthorization", "message": "Insufficient authorization to access requested resource.", "moreDetails":"Only these values are allowed: Webpages,Images,Videos,News,SpellSuggestions,entities,places,RelatedSearches,Computation,TimeZone,Translations", "parameter": "responseFilter", "value": "Webpages%2CSpellSuggestions" }]}
I tried both: responseFilter: ['Webpages', 'SpellSuggestions'] and responseFilter: ['Webpages,SpellSuggestions'], the same result.

azure-servicefabric does not support client certificate authentication

When connecting to a secure service fabric cluster a common way it to use client certificate to authenticate.
this is supported by the sfctl cli tool by specifying a pem file path.

seems like the ServiceFabricClient class which extends ServiceClient does not receieve a ServiceClientCredentials in its constuctor and there is not implementation of ServiceClientCredentials for ClientCertificateAuthorization.

this is the equivalent implementation in python used by the sfctl cli tool:
https://github.com/Azure/service-fabric-cli/blob/master/src/sfctl/auth.py#L13

How to build requiredResourceAccess when creating application via Graph

Hi,

I have been able to create an application & service principal using the Graph (by utilising this script, however I am not able to see how we can programatically build the required permissions to set for requiredResourceAccess in the application.

If I hand-build an application & service principal in the Azure portal, I am able to go into the Required Permissions page and manually add/select permissions e.g.

Microsoft Graph -> APPLICATION PERMISSION -> Read and write all users' full profiles

If I then examine the application in the Graph Explorer, I can see that requiredResourceAccess contains this for my application:

    "requiredResourceAccess": [
        {
            "resourceAppId": "00000003-0000-0000-c000-000000000000",
            "resourceAccess": [
                {
                    "id": "741f803b-c850-494e-b5df-cde7c675a1ca",
                    "type": "Role"
                }
            ]
        }
    ],

What Node.js SDK / REST API can I call to get the list of available APIs and their application/delegated permissions that are displayed in the Portal, along with the ID's need for resourceAccess so that we can set the correct permissions in code when we create the application?

Also, what API would I use to find the "resourceAppId" needed for this setting?

Thanks,
Mike.

Error: 401 - ExpiredToken: The token is expired on Daylight Saving Time Change

Hi!

As you know, we changed the time from Daylight Saving to Normal Time in North America.

As soon as the hour passed from 1:59 to 1:00, Azure Service Bus gave me the message "Error: 401 - ExpiredToken: The token is expired"

Even if I killed my app and restart it, I got the same error.

When my computer time reached 2:00, then I was back to normal...

Should'nt Service Bus be aware of time changing?

Thanks

2018-11-04T01:59:24-04:00 16540 Waiting for messages...
2018-11-04T01:00:24-05:00 16540 Waiting for messages...
2018-11-04T01:00:25-05:00 16540 ===> azure sdk RX ERROR:  { Error: 401 - ExpiredToken: The token is expired. Expiration time: '2018-11-04 05:05:25Z'. TrackingId:04fd8272-9120-4d
    at Function.ServiceClient._normalizeError (/tuxedo/cotecour/v2018-09-01/TuxedoBackend/node_modules/azure-common/lib/services/serviceclient.js:814:23)
    at ServiceBusService.ServiceClient._processResponse (/tuxedo/cotecour/v2018-09-01/TuxedoBackend/node_modules/azure-common/lib/services/serviceclient.js:455:41)
    at Request.processResponseCallback [as _callback] (/tuxedo/cotecour/v2018-09-01/TuxedoBackend/node_modules/azure-common/lib/services/serviceclient.js:213:35)
    at Request.self.callback (/tuxedo/cotecour/v2018-09-01/TuxedoBackend/node_modules/request/request.js:185:22)
    at emitTwo (events.js:106:13)
    at Request.emit (events.js:191:7)
    at Request.<anonymous> (/tuxedo/cotecour/v2018-09-01/TuxedoBackend/node_modules/request/request.js:1161:10)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at IncomingMessage.<anonymous> (/tuxedo/cotecour/v2018-09-01/TuxedoBackend/node_modules/request/request.js:1083:12)
    at IncomingMessage.g (events.js:291:16)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
  code: '401',
  detail: 'ExpiredToken: The token is expired. Expiration time: \'2018-11-04 05:05:25Z\'. TrackingId:04fd8272-9120-4d3d-a910-31be570e105c_G12, SystemTracker:tuxedo.servicebus.wi
  statusCode: 401 }
2

The resource name presented contains invalid character '/'

In the azure service bus bindings, of an Azure function, when we select
"If true, creates the Azure Cosmos DB database and collection "
then
with OR with giving partition key
following exception occurs
2017-11-02T04:45:22.460 Exception while executing function: Functions.MyFunc. Microsoft.Azure.Documents.Client: The resource name presented contains invalid character '/'.

azure-eventgrid ECONNRESET

The following code fails intermittently with ECONNRESET, sometimes when we call it a few times or sometimes after 50 calls, yet is usually a failure of 10%. This occurs if we run the code locally in development or pushed up to an azure web app.

let topicCreds = new msRestAzure.TopicCredentials(config.eventGrid.key);
let client = new EventGridClient(topicCreds);
let topicHostName = config.eventGrid.uri;
client.publishEvents(topicHostName, events)
.then(function (result: any) {
appInsights.defaultClient.trackTrace({ message: 'eventGrid', properties: { success: 'true' }});
})
.catch(function (publishError: any) {
appInsights.defaultClient.trackTrace({ message: 'eventGrid', properties: { success: 'false' }});
appInsights.defaultClient.trackException({ exception: publishError });
});

Microsoft Azure SDK for Node.js - Cognitive Services Spellcheck not working

When trying to run the sample from https://www.npmjs.com/package/azure-cognitiveservices-spellcheck it creates the spellcheck services within my Azure sub but when I then try to call it with the following code snippet I get an empty result back:

const CognitiveServicesCredentials = require('ms-rest-azure').CognitiveServicesCredentials;
const SpellCheckAPIClient = require('azure-cognitiveservices-spellcheck');
// Creating the Cognitive Services credentials
// This requires a key corresponding to the service being used (i.e. text-analytics, etc)
let credentials = new CognitiveServicesCredentials(<serviceKey>);
let client = new SpellCheckAPIClient(credentials);
let options = {
  text: 'cognituve services'
};
client.spellChecker(options, (err, result, request, response) => {
  if (err) throw err;
  console.log(result);
  console.log(result.flaggedTokens[0].token);
  console.log(result.flaggedTokens[0].suggestions[0].suggestion);
});

This is the result and error I get logged out:

C:\Users\sbi\source\repos\testspellcheck>node spellcheck.js
{ _type: 'SpellCheck', flaggedTokens: [] }
C:\Users\sbi\source\repos\testspellcheck\spellcheck.js:49
console.log(result.flaggedTokens[0].token);
^

TypeError: Cannot read property 'token' of undefined
at client.spellChecker (C:\Users\sbi\source\repos\testspellcheck\spellcheck.js:49:39)
at client.pipeline (C:\Users\sbi\source\repos\testspellcheck\node_modules\azure-cognitiveservices-spellcheck\lib\spellCheckAPIClient.js:481:12)
at retryCallback (C:\Users\sbi\source\repos\testspellcheck\node_modules\ms-rest\lib\filters\systemErrorRetryPolicyFilter.js:89:9)
at retryCallback (C:\Users\sbi\source\repos\testspellcheck\node_modules\ms-rest\lib\filters\exponentialRetryPolicyFilter.js:140:9)
at C:\Users\sbi\source\repos\testspellcheck\node_modules\ms-rest\lib\filters\rpRegistrationFilter.js:59:14
at handleRedirect (C:\Users\sbi\source\repos\testspellcheck\node_modules\ms-rest\lib\filters\redirectFilter.js:39:9)
at C:\Users\sbi\source\repos\testspellcheck\node_modules\ms-rest\lib\filters\formDataFilter.js:23:14
at Request.defaultRequest [as _callback] (C:\Users\sbi\source\repos\testspellcheck\node_modules\ms-rest\lib\requestPipeline.js:125:16)
at Request.self.callback (C:\Users\sbi\source\repos\testspellcheck\node_modules\request\request.js:185:22)
at emitTwo (events.js:126:13)

Receiving "Too much pending tasks" error when we use the library to send multiple concurrent messages from a node express app

Receiving "Too much pending tasks" error when we use the library to send messages from a node express app. The issue occurs when we make multiple concurrent calls to await client.send(eventData)

To Reproduce
Make multiple concurrent calls to await client.send(eventData)

Package-name: azure-event-hubs
Package-version: 0.2.5
node.js version: 10.0.0
OS name and version: Azure App Service ,node-express app, Windows

Error Call stack

[
    {
        "outerId": "0",
        "message": "Too much pending tasks",
        "severityLevel": "Error",
        "parsedStack": [
            {
                "assembly": "at AppInsightsAsyncCorrelatedErrorWrapper.ZoneAwareError (D:\\home\\site\\wwwroot\\node_modules\\zone.js\\dist\\zone-node.js:811:33)",
                "method": "AppInsightsAsyncCorrelatedErrorWrapper.ZoneAwareError",
                "level": 0,
                "line": 811,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\zone.js\\dist\\zone-node.js"
            },
            {
                "assembly": "at new AppInsightsAsyncCorrelatedErrorWrapper (D:\\home\\site\\wwwroot\\node_modules\\applicationinsights\\out\\AutoCollection\\CorrelationContextManager.js:193:18)",
                "method": "new AppInsightsAsyncCorrelatedErrorWrapper",
                "level": 1,
                "line": 193,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\applicationinsights\\out\\AutoCollection\\CorrelationContextManager.js"
            },
            {
                "assembly": "at AsyncLock.acquire (D:\\home\\site\\wwwroot\\node_modules\\async-lock\\lib\\index.js:141:15)",
                "method": "AsyncLock.acquire",
                "level": 2,
                "line": 141,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\async-lock\\lib\\index.js"
            },
            {
                "assembly": "at EventHubSender.send (D:\\home\\site\\wwwroot\\node_modules\\azure-event-hubs\\dist\\lib\\eventHubSender.js:75:49)",
                "method": "EventHubSender.send",
                "level": 3,
                "line": 75,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\azure-event-hubs\\dist\\lib\\eventHubSender.js"
            },
            {
                "assembly": "at EventHubClient.send (D:\\home\\site\\wwwroot\\node_modules\\azure-event-hubs\\dist\\lib\\eventHubClient.js:74:29)",
                "method": "EventHubClient.send",
                "level": 4,
                "line": 74,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\azure-event-hubs\\dist\\lib\\eventHubClient.js"
            },            
            {
                "assembly": "at Layer.handle [as handle_request] (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\layer.js:95:5)",
                "method": "Layer.handle [as handle_request]",
                "level": 8,
                "line": 95,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\layer.js"
            },
            {
                "assembly": "at next (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\route.js:137:13)",
                "method": "next",
                "level": 9,
                "line": 137,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\route.js"
            },
            {
                "assembly": "at Route.dispatch (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\route.js:112:3)",
                "method": "Route.dispatch",
                "level": 10,
                "line": 112,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\route.js"
            },
            {
                "assembly": "at Layer.handle [as handle_request] (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\layer.js:95:5)",
                "method": "Layer.handle [as handle_request]",
                "level": 11,
                "line": 95,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\layer.js"
            },
            {
                "assembly": "at D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js:281:22",
                "method": "<no_method>",
                "level": 12,
                "line": 281,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js"
            },
            {
                "assembly": "at param (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js:354:14)",
                "method": "param",
                "level": 13,
                "line": 354,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js"
            },
            {
                "assembly": "at param (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js:365:14)",
                "method": "param",
                "level": 14,
                "line": 365,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js"
            },
            {
                "assembly": "at Function.process_params (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js:410:3)",
                "method": "Function.process_params",
                "level": 15,
                "line": 410,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js"
            },
            {
                "assembly": "at next (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js:275:10)",
                "method": "next",
                "level": 16,
                "line": 275,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js"
            },
            {
                "assembly": "at Function.handle (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js:174:3)",
                "method": "Function.handle",
                "level": 17,
                "line": 174,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js"
            },
            {
                "assembly": "at router (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js:47:12)",
                "method": "router",
                "level": 18,
                "line": 47,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js"
            },
            {
                "assembly": "at Layer.handle [as handle_request] (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\layer.js:95:5)",
                "method": "Layer.handle [as handle_request]",
                "level": 19,
                "line": 95,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\layer.js"
            },
            {
                "assembly": "at trim_prefix (D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js:317:13)",
                "method": "trim_prefix",
                "level": 20,
                "line": 317,
                "fileName": "D:\\home\\site\\wwwroot\\node_modules\\express\\lib\\router\\index.js"
            }
        ],
        "type": "Error",
        "id": "0"
    }
]

Wrong parameter type in documentation?

I was checking the NotificationHubs documentation, specifically the createOrUpdateInstallation method:

https://github.com/Azure/azure-sdk-for-node/blob/5f092e7e4f13a1801d94350d6b9d488cc61fea95/lib/services/serviceBus/lib/notificationhubservice.js#L467

Its first parameter is documented as string.

https://github.com/Azure/azure-sdk-for-node/blob/5f092e7e4f13a1801d94350d6b9d488cc61fea95/lib/services/serviceBus/lib/notificationhubservice.js#L461

But I think it should be an object. I checked the source and it indeed looks like an object. It even validates it as an object:

https://github.com/Azure/azure-sdk-for-node/blob/5f092e7e4f13a1801d94350d6b9d488cc61fea95/lib/services/serviceBus/lib/notificationhubservice.js#L473

It also should have its properties documented, one of which is installationId and I think the others are:
pushChannel, platform, tags, installationId,

apns.listRegistrationsByToken doesnt return Tags in response?

The response doesn't match that of "gcm.listRegistrationsByGcmRegistrationId" in that it does not include the Tags property.

In addition "listRegistrationsByTag" does not return apns registrations that have had the Tag added. Adding tags to apns registrations returns a response with the correct Tags, but it doesnt seem to persist.

Improve CI

  • remove cloning specs repo.
  • switch to Ubuntu.
  • move the CI job to public space.

Direct mode / tcp support

Like already issued in the "old" repository (Azure/azure-cosmosdb-node#78) it would be a big improvement if the new library would support direct mode / tcp connection. The performance with http calls is quite bad actually.
In the linked issue this is already planned since 2015.

Maybe this can be integrated easier in to the new code base.

"keyvault.d.ts" loaded "keyVaultClient" file in wrong way

in "keyvault.d.ts" file
import * as KeyVaultClientBase from './KeyVaultClient'

as in the 'KeyVaultClient.d.ts'
it is expoerted as
export = KeyVaultClient

in "keyvault.d.ts" file it should import ''KeyVaultClient.d.ts' like

import KeyVaultClientBase = require('./KeyVaultClient'')

please incorporate this changes else in typescript it will throw error.

Fields that need an id should accept an object with id on it

When I'm trying to get a database via .get (soon to be .database(id), etc.), I should be able to just pass an id string or an object with an id property (like all of our definition objects).

Example:

const db = client.database("foo");
/* OR */
const db = client.database({id: "foo"});
/* Also */
const {body: dbdef} = await client.databases.create({id: "foo"});
const db = client.database(dbdef);

Support default Request/Feed options at each object level

If you're setting request or feed options, it's fairly frequent that you ALWAYS want to set them for that particular target, especially once we split (Paritioned) Container from NonPartitionedContainer so it'll be less often you need to dynamically touch the parittionkey/etc.

Browser install instructions invalid

When using the containerinstance component from the browser it appears that the install instructions listed in the resources readme are no longer valid.

<script src="node_modules/ms-rest-js/dist/msRest.browser.js"></script>
    <script src="node_modules/ms-rest-azure-js/dist/msRestAzure.js"></script>
    <script src="node_modules/ms-rest-browserauth/dist/msAuth.js"></script>
    <script src="node_modules/@azure/arm-containerinstance/dist/arm-containerinstance.js"></script>

results in:

Loading failed for the <script> with source “http://127.0.0.1:5500/client/node_modules/ms-rest-js/dist/msRest.browser.js”. index.html:19:1
Loading failed for the <script> with source “http://127.0.0.1:5500/client/node_modules/ms-rest-azure-js/dist/msRestAzure.js”. index.html:20:1
Loading failed for the <script> with source “http://127.0.0.1:5500/client/node_modules/ms-rest-browserauth/dist/msAuth.js”. index.html:21:1
Loading failed for the <script> with source “http://127.0.0.1:5500/client/node_modules/@azure/arm-containerinstance/dist/arm-containerinstance.js”. index.html:22:1
ReferenceError: msRest is not defined[Learn More] index.html:31:19
createACIInstance
http://127.0.0.1:5500/client/index.html#:31:19
<anonymous>
http://127.0.0.1:5500/client/index.html#:29:9

How do we send custom objects in json payload templates?

hdinsightjob2.js createHDInsightJobManagementClient flipped arguments

the function createHDInsightJobManagementClient, under azure-arm-hdinsight-jobs/lib/hdinsightjob2.js has the signature of:
function (credentials, baseUri, filters)
but it delegates to the constructor HDInsightJobManagementClient (under azure-arm-hdinsight-jobs/lib/hDInsightJobManagementClient.js) which has a different signature:
function HDInsightJobManagementClient(clusterDnsName, credentials, filters).

Notice that credentials and cluster host name were switched. Whoever is using createHDInsightJobManagementClient must now workaround this by passing arguments in the undocumented correct order.

High timeout for Commerce UsageAggregates list (on 504 gateway error)

There seems to be an issue with the UsageAggregates API of Azure. When I make a request directly to the REST API, I get a 504 Gateway Timeout error after 60 seconds. When using the SDK (azure-arm-commerce) to make the call (client.usageAggregates.list), I get the same response.

However, the SDK call takes over 700 seconds to come back with an answer, whereas the API already timed out after a minute. Is this difference in timeout intended, or is something going wrong in the SDK?

Read basic user profiles

Hi all,

We need to fetch all the users basic profiles for a organization. Right now I'm trying to fetch them though the azure node ask with the following code:

graphClient.users.list()

Unfortunatly the SDK returns an insufficient priviliges error possibly due to the user models containing more information. Is there any working solution on how to fetch all the users with their basic information?

Thanks!

factory methods for conflict strategies

We currently have 4 variants of the Conflict Resolution policies:

  1. Manual
  2. Manual w/ sproc
  3. LWW
  4. LWW w/ custom setting

There will eventually be more.

There are error conditions such as the sproc setting and the lww setting both being set.

To make it easier to create a policy for these 4 scenarios, and future ones, we'd like to create a factory object which simplifies the creation of the policy, without abstracting away the underlying type/format all together. Java SDK has already added this, so it can serve as a good example of the scenarios, though implementation may differ for JavaScript.

API for getting a tenant with display name

Hi,

Is there an API exposed via the SDK for getting a tenant with its display name too?

There is this API to list tenants, but that only gives you the tenant ID and not the name e.g. mydomain.onmicrosoft.com.

Also, I don't see a get API either to describe the tenant in more detail, just the list with the basic info?

Thanks,
Mike.

Module for Azure Functions

Hi there,

you write in the README "we haven't provided fine-grained modules for every supported Microsoft Azure services 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.".

I would like to do that for the Azure Functions service. The CLI contains various commands for managing, invoking etc. Azure Functions, but the Node SDK lacks this ability.

Thanks!

@azure/arm-storage doesn't compile properly

> @azure/[email protected] prepack /Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-storage
> npm install && npm run build

updated 2 packages and audited 55 packages in 1.2s
found 0 vulnerabilities


> @azure/[email protected] build /Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-storage
> tsc && rollup -c rollup.config.js && npm run minify

lib/operations/blobService.ts:42:167 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-storage/lib/models/index"' has no exported member 'BlobServiceSetServicePropertiesResponse'.

42   setServiceProperties(resourceGroupName: string, accountName: string, parameters: Models.BlobServiceProperties, options?: msRest.RequestOptionsBase): Promise<Models.BlobServiceSetServicePropertiesResponse>;
                                                                                                                                                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/blobService.ts:66:232 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-storage/lib/models/index"' has no exported member 'BlobServiceSetServicePropertiesResponse'.

66   setServiceProperties(resourceGroupName: string, accountName: string, parameters: Models.BlobServiceProperties, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.BlobServiceProperties>): Promise<Models.BlobServiceSetServicePropertiesResponse> {
                                                                                                                                                                                                                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/blobService.ts:75:35 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-storage/lib/models/index"' has no exported member 'BlobServiceSetServicePropertiesResponse'.

75       callback) as Promise<Models.BlobServiceSetServicePropertiesResponse>;
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/blobService.ts:89:125 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-storage/lib/models/index"' has no exported member 'BlobServiceGetServicePropertiesResponse'.

89   getServiceProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise<Models.BlobServiceGetServicePropertiesResponse>;
                                                                                                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/blobService.ts:109:190 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-storage/lib/models/index"' has no exported member 'BlobServiceGetServicePropertiesResponse'.

109   getServiceProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase, callback?: msRest.ServiceCallback<Models.BlobServiceProperties>): Promise<Models.BlobServiceGetServicePropertiesResponse> {
                                                                                                                                                                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

lib/operations/blobService.ts:117:35 - error TS2694: Namespace '"/Users/kamip/Repos/azure-sdk-for-js/packages/@azure/arm-storage/lib/models/index"' has no exported member 'BlobServiceGetServicePropertiesResponse'.

117       callback) as Promise<Models.BlobServiceGetServicePropertiesResponse>;
                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/[email protected] build: `tsc && rollup -c rollup.config.js && npm run minify`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @azure/arm-storage@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kamip/.npm/_logs/2018-11-08T01_25_12_425Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/[email protected] prepack: `npm install && npm run build`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @azure/arm-storage@0.1.0 prepack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/kamip/.npm/_logs/2018-11-08T01_25_12_453Z-debug.log

[Event Hubs] Improve the current implementation of Sender

The current sender has a promise wrapper around the rhea sender which is based on event emitter pattern. Every time a message is sent, event handlers are added and removed and the promise is resolved or rejected based on the type of event received. This design works well as long as the customer is awaiting on the previous send (i.e an eventhub client is sending one message at a time).

If too many messages are sent, then this causes the node.js error too many listeners attached, by default only 11 (max) are allowed.

A better appraoch would be add all the event handlers at the time of creating the sender link and then maintaining an internal map of the messages being sent. The promises would be resolved or rejected based on the type of event received.
Things that make this approach a little complex are:

  • rhea internally has a circular buffer that throttles the number of messages being sent. If the messages cannot be sent then we need to wait for sometime before attempting to send them.
  • How do we handle retry attempts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.