diff --git a/sdk/storage/azure-storage-blobs/CHANGELOG.md b/sdk/storage/azure-storage-blobs/CHANGELOG.md index 4ac5b1495..c2fed0bce 100644 --- a/sdk/storage/azure-storage-blobs/CHANGELOG.md +++ b/sdk/storage/azure-storage-blobs/CHANGELOG.md @@ -5,6 +5,7 @@ ### New Features * `CreateIfNotExists` and `DeleteIfExists` for blob containers and blobs. +* Add `IsHierarchicalNamespaceEnabled` in `GetAccountInfoResult`. ### Breaking Changes diff --git a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp index 84c82da2c..75f1a44eb 100644 --- a/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp +++ b/sdk/storage/azure-storage-blobs/inc/azure/storage/blobs/protocol/blob_rest_client.hpp @@ -683,6 +683,7 @@ namespace Azure { namespace Storage { namespace Blobs { { Blobs::Models::SkuName SkuName = Blobs::Models::SkuName::Unknown; Blobs::Models::AccountKind AccountKind = Blobs::Models::AccountKind::Unknown; + bool IsHierarchicalNamespaceEnabled = false; }; // struct GetAccountInfoResult struct GetBlobContainerAccessPolicyResult @@ -1946,6 +1947,8 @@ namespace Azure { namespace Storage { namespace Blobs { response.SkuName = SkuNameFromString(httpResponse.GetHeaders().at("x-ms-sku-name")); response.AccountKind = AccountKindFromString(httpResponse.GetHeaders().at("x-ms-account-kind")); + response.IsHierarchicalNamespaceEnabled + = httpResponse.GetHeaders().at("x-ms-is-hns-enabled") == "true"; return Azure::Core::Response( std::move(response), std::move(pHttpResponse)); } diff --git a/sdk/storage/azure-storage-blobs/test/blob_service_client_test.cpp b/sdk/storage/azure-storage-blobs/test/blob_service_client_test.cpp index a7067a6f4..81a006337 100644 --- a/sdk/storage/azure-storage-blobs/test/blob_service_client_test.cpp +++ b/sdk/storage/azure-storage-blobs/test/blob_service_client_test.cpp @@ -319,6 +319,12 @@ namespace Azure { namespace Storage { namespace Test { auto accountInfo = *m_blobServiceClient.GetAccountInfo(); EXPECT_NE(accountInfo.SkuName, Blobs::Models::SkuName::Unknown); EXPECT_NE(accountInfo.AccountKind, Blobs::Models::AccountKind::Unknown); + EXPECT_FALSE(accountInfo.IsHierarchicalNamespaceEnabled); + + auto dataLakeServiceClient + = Blobs::BlobServiceClient::CreateFromConnectionString(AdlsGen2ConnectionString()); + accountInfo = *dataLakeServiceClient.GetAccountInfo(); + EXPECT_TRUE(accountInfo.IsHierarchicalNamespaceEnabled); } TEST_F(BlobServiceClientTest, Statistics)