I’m trying to get account info to find out if hierarchical namespace is enabled or not. But if I use OAuth method, this function fails…
There is no official statement, or at least I did not found it, but this comment in the unit tests.
TEST_F(BlobServiceClientTest, AccountInfo_LIVEONLY_)
{
// This operation doesn't support OAuth-based authorization.
auto serviceClient
= Blobs::BlobServiceClient::CreateFromConnectionString(StandardStorageConnectionString());
auto accountInfo = serviceClient.GetAccountInfo().Value;
EXPECT_FALSE(accountInfo.SkuName.ToString().empty());
EXPECT_FALSE(accountInfo.AccountKind.ToString().empty());
EXPECT_FALSE(accountInfo.IsHierarchicalNamespaceEnabled);
auto containerClient = serviceClient.GetBlobContainerClient(LowercaseRandomString());
accountInfo = containerClient.GetAccountInfo().Value;
EXPECT_FALSE(accountInfo.SkuName.ToString().empty());
EXPECT_FALSE(accountInfo.AccountKind.ToString().empty());
EXPECT_FALSE(accountInfo.IsHierarchicalNamespaceEnabled);
auto blobClient = containerClient.GetBlobClient(RandomString());
accountInfo = blobClient.GetAccountInfo().Value;
EXPECT_FALSE(accountInfo.SkuName.ToString().empty());
EXPECT_FALSE(accountInfo.AccountKind.ToString().empty());
EXPECT_FALSE(accountInfo.IsHierarchicalNamespaceEnabled);
}
So my question is, how to find out if hierarchical namespace is enabled or not using OAuth?