【问题标题】:The difference between @azure/ms-rest-nodeauth and ms-rest-azure@azure/ms-rest-nodeauth 和 ms-rest-azure 之间的区别
【发布时间】:2020-01-08 05:07:13
【问题描述】:

我在这两个包中看到了许多相同的方法,当我使用 ms-rest-azure(loginWithServicePrincipalSecret) 创建凭据并使用凭据实例化 SubscriptionClient 时,出现错误:

Argument of type 'ApplicationTokenCredentials' is not assignable to parameter of type 'ServiceClientCredentials'.
  Types of property 'signRequest' are incompatible.
    Type '(webResource: WebResource, callback: (err: Error) => void) => void' is not assignable to type '(webResource: WebResource) => Promise<WebResource>'.ts(2345)

但是当我更改为 @azure/ms-rest-nodeauth 并使用 loginWithServicePrincipalSecret 创建凭据并使用凭据实例化 SubscriptionClient 时,它运行良好。

所以我想知道为什么以及@azure/ms-rest-nodeauth 和 ms-rest-azure 之间的区别。

谢谢。

【问题讨论】:

    标签: javascript node.js azure


    【解决方案1】:

    ms-rest-azure 是适用于 Azure 的 Node SDK 的基本模块。 @azure/ms-rest-nodeauth 是专门用于处理身份验证的相关包。最近看起来确实存在一些版本之间类型更改不匹配的问题:https://github.com/Azure/ms-rest-nodeauth/issues/67

    很高兴听到您能够解决问题。我鼓励您在product Github 上提出问题,以便其他开发人员可以修复它。请务必注明您正在使用的软件包版本,以便他们知道在哪里查找问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-11
      • 2016-12-05
      • 2014-02-28
      • 1970-01-01
      • 2020-04-09
      • 2015-09-10
      相关资源
      最近更新 更多