[英]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.