我想知道是否没有实际的实现来使用 C# 和 azure 托管标识访问 blobstorage?
我知道可以通过已弃用的 nuget 包 WindowsAzure.Storage 9.3.3 访问它,但看起来新的 Microsoft.Azure.Storage.Blob 11.2.1 尚未实现此功能。 ..
我错过了什么吗?
最佳答案
Azure.Identity
库具有 TokenCredential
抽象类的实现,可用于对 Azure.Storage.Blobs
中的客户端进行身份验证图书馆。 ManagedIdentityCredential
可用于对启用了托管身份的 Azure 主机上的客户端进行身份验证。
var blobServiceClient = new BlobServiceClient(new Uri($"https://{AccountName}.blob.core.windows.net"), new ManagedIdentityCredential());
有关 Azure.Identity
库的更多信息,请访问 here .
关于c# - 通过托管身份访问 AzureBlobStorage c#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63772633/