【问题标题】:How to connect Storage with Access Keys (managed by Azure Vault) in Azure Function code如何在 Azure Function 代码中使用访问密钥(由 Azure Vault 管理)连接存储
【发布时间】:2021-08-11 13:09:03
【问题描述】:

在 Azure 中创建了一个存储帐户。 然后还创建了 Key Vault。 按照以下链接允许 Azure Vault 管理存储访问密钥。 https://docs.microsoft.com/en-us/azure/key-vault/secrets/overview-storage-keys-powershell

在 Azure 函数中,我想使用 key1 或 key2 访问此存储 blob。现在如何访问key1或key2?

【问题讨论】:

标签: azure azure-active-directory azure-functions azure-storage


【解决方案1】:

您可以使用StorageSharedKeyCredential 将存储与accountKey 连接起来。

StorageSharedKeyCredential storageSharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);

BlobServiceClient blobServiceClient = new BlobServiceClient(new Uri("https://"+accountName+".blob.core.windows.net"), storageSharedKeyCredential);

【讨论】:

    猜你喜欢
    • 2021-01-26
    • 2019-07-28
    • 2020-02-11
    • 2019-12-24
    • 2021-04-26
    • 2020-08-27
    • 2017-10-30
    • 2020-08-12
    • 2022-11-26
    相关资源
    最近更新 更多