简体   繁体   English

如何将 MSI(托管服务标识)与 Azure 存储模拟器一起使用?

[英]How to use MSI(Managed Service Identity) with Azure storage emulator?

Currently I am using MSI in my code.目前我在我的代码中使用 MSI。 But when I test it locally I want to use azure storage emulator and blob storage in it.但是当我在本地测试它时,我想在其中使用 azure 存储模拟器和 blob 存储。 MSI is working well with the cloud storage, but when it comes to the local storage emulator, I don't know how to do it. MSI在云存储上运行良好,但是到了本地存储模拟器,我不知道该怎么做。 Because local storage emulator requires fixed account and key.因为本地存储模拟器需要固定的账号和密钥。 Does local storage emulator supports MSI?本地存储模拟器是否支持 MSI? How should I use it?我应该如何使用它? My code is like this我的代码是这样的

const string StorageResource = "http://127.0.0.1:10000/devstoreaccount1";
AzureServiceTokenProvider tokenProvider = new AzureServiceTokenProvider();
AppAuthenticationResult authResult = await tokenProvider.GetAuthenticationResultAsync(
                StorageResource, null, cancellationToken).ConfigureAwait(false);

No, you can't.不,你不能。

The storage emulator just uses a local Microsoft SQL Server instance and file system to emulate azure storage.存储模拟器仅使用本地 Microsoft SQL Server 实例和文件系统来模拟 Azure 存储。 The MSI is just for the azure service that supports Azure AD authentication, which storage emulator does not. MSI 仅用于支持 Azure AD 身份验证的 azure 服务,而存储模拟器不支持。

Reference - Services that support managed identities for Azure resources参考 - 支持 Azure 资源的托管标识的服务

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 Azure 托管标识与 Azure.Storage.Blobs.BlobServiceClient 一起使用? - How to use Azure managed identity with Azure.Storage.Blobs.BlobServiceClient? 如何使用 Service Principal/Managed Identity 访问 Azure App Configuration? - How to use Service Principal/Managed Identity to access Azure App Configuration? Microsoft.ServiceBus.NamespaceManager-托管服务身份(MSI) - Microsoft.ServiceBus.NamespaceManager - Managed Service Identity(MSI) 如何在本地开发环境中使用 Azure.Identity 连接到服务总线和存储队列 - How to use Azure.Identity in local dev environment to connect to service bus and storage queue Azure Function 函数如何使用托管标识获取对 Azure 表存储的引用? - How can an Azure Function function get a reference to Azure Table storage using Managed Identity? 无法使用 Azure 中的系统分配的托管标识使用 blob 存储操作 - Not able to use blob storage operations using System Assigned Managed Identity in Azure Azure 函数 - 使用托管标识的队列触发器 - Azure Functions - use queue trigger with managed identity Azure 存储帐户使用托管标识和 C# 进行身份验证 - Azure Storage Account authenticate using Managed Identity and C# 登录 Azure 数据库时,如何配置 Nhibernate 以使用 Azure Managed Identity? - How can i configure Nhibernate to use Azure Managed Identity when logging into Azure database? 在Azure函数中使用Azure Fluent SDK时,如何使用托管服务标识创建azure对象? - When using the Azure Fluent SDK in an Azure Function how can I create an azure object using a Managed Service Identity?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM