1

我想Azure Storage Account Key (connectionString)使用 azure.NET SDK 或 fluent API。

在此处输入图像描述

4

1 回答 1

2

尝试这个 :

    var azure = Azure.Configure().Authenticate(credentials).WithSubscription(subscriptionID);

    var storageName = "<storage name>";
    var resourceGroup = "<storage resource group>";

    var keys = azure.StorageAccounts.GetByResourceGroup(resourceGroup, storageName).GetKeys();
    
    var key1 = keys[0];
    var key2 = keys[1];

    var connStr1 = "DefaultEndpointsProtocol=https;AccountName=" + storageName + ";AccountKey="+ key1.Value + ";EndpointSuffix=core.windows.net";
    var connStr2 = "DefaultEndpointsProtocol=https;AccountName=" + storageName + ";AccountKey=" + key2.Value + ";EndpointSuffix=core.windows.net";
于 2021-06-04T01:24:54.710 回答