【问题标题】:How to use MSI for development in visual studio code?如何在 Visual Studio 代码中使用 MSI 进行开发?
【发布时间】:2019-05-18 02:00:17
【问题描述】:

是否可以通过命令行或 Visual Studio Code 使用托管服务标识?
我看到有一个extension for Visual Studio。 VS Code 或 Azure 外部可访问的 MSI 端点是否有类似的东西?

如果不是,模拟/绕过 MSI 身份验证的正确方法是什么?

比你提前!

编辑:我正在使用 nodejs 并尝试让 Keyvault 与 MSI 一起工作,遵循 this example

【问题讨论】:

    标签: azure azure-keyvault azure-managed-identity azure-node-sdk


    【解决方案1】:

    您可以使用az login 登录AZ CLI,Microsoft.Azure.Services.AppAuthentication 库将使用它作为它尝试的方法之一。

    不幸的是,这种方法不适用于 NodeJS 库,并在此处进行跟踪:https://github.com/Azure/azure-sdk-for-node/issues/2284

    只要确保您登录到正确的租户即可。

    至少如果尝试连接 Azure Key Vault,您还需要使用az account set -s "My Azure Subscription name or id" 选择订阅。

    在命令提示符下登录后,您可能需要重新启动 VS Code。

    【讨论】:

    • 不幸的是,在我登录后,选择订阅并启动我的节点应用程序,它无法显示Error: Either provide "msiEndpoint" as a property of the "options" object or set the environment variable "MSI_ENDPOINT" and it must be of type "string".
    • 啊,你有一个节点应用程序 :) 根据错误,它听起来不支持这种方法。
    • 目前不支持使用 Azure CLI 进行 Node SDK 的本地开发。它正在这里被跟踪 - github.com/Azure/azure-sdk-for-node/issues/2284
    猜你喜欢
    • 2018-05-25
    • 1970-01-01
    • 1970-01-01
    • 2010-11-25
    • 1970-01-01
    • 2013-11-01
    • 1970-01-01
    • 2012-05-18
    • 1970-01-01
    相关资源
    最近更新 更多