Open Archomeda opened 1 year ago
Thank you for your feedback. This has been routed to the support team for assistance.
@Archomeda Thanks for reaching out to us and reporting this issue. We are looking into this issue and we will provide an update.
@Archomeda I am able to run the below sample code successfully and it worked just fine. Could you please let us know the Storage Account kind ? This is present in the Azure Storage portal blade within the configuration section as shown below:
The Access Tiers are supported for general-purpose v2 or Blob Storage account types. Please check the type of your storage account. I am guessing you might be using GpV1 storage account which doesn't support Access Tier.
Sample Code:
string connectionString = "Storage Account - Connection String";
// Create a BlobServiceClient object which will be used to create a container client
BlobServiceClient blobServiceClient = new BlobServiceClient(connectionString);
//Create a unique name for the container
string containerName = "MyContainerName" + Guid.NewGuid().ToString();
// Create the container and return a container client object
BlobContainerClient containerClient = await blobServiceClient.CreateBlobContainerAsync(containerName);
// Create a local file in the ./data/ directory for uploading and downloading
string localPath = "./data/";
string fileName = "MyBlob.txt";
string localFilePath = Path.Combine(localPath, fileName);
// Write text to the file
await File.WriteAllTextAsync(localFilePath, "HelloWorld");
// Get a reference to a blob
BlobClient blobClient = containerClient.GetBlobClient(fileName);
var uploadOptions = new BlobUploadOptions
{
AccessTier = AccessTier.Hot
};
await blobClient.UploadAsync(localFilePath, options: uploadOptions);
More Info here.
@navba-MSFT The sample is just about reproducing that ErrorCode when writing to V1 storage accounts, as I've mentioned in the bug description. That V1 storage accounts do not support AccessTiers, is understandable, but the BlobErrorCode type should at least contain that error code definition as well.
@Archomeda Thanks for clarifying this. We will update our documentation to include this information.
@Archomeda PR to update the docs is now merged https://github.com/Azure/azure-sdk-for-net/pull/32968. See the other thread https://github.com/Azure/azure-sdk-for-net/issues/32910
@navba-MSFT This is a different issue. This is about the BlobErrorCode class missing the BlobAccessTIerNotSupportedForAccountType string, and not about the documentation not clarifying that the AccessTier can be null.
Thanks for clarifying. I am adding service team to look into this.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.
Author: | Archomeda |
---|---|
Assignees: | - |
Labels: | `Storage`, `Service Attention`, `Client`, `customer-reported`, `feature-request`, `needs-team-attention` |
Milestone: | - |
@xgithubtriage Could you please look into this request ?
This is a simple fix, we should take this.
Library name and version
Azure.Storage.Blobs 12.14.1
Describe the bug
Azure.Storage.Blobs.Models.BlobErrorCode doesn't contain the BlobAccessTierNotSupportedForAccountType error code that occurs when setting an AccessTier when writing a new blob to a V1 storage account.
Expected behavior
Azure.Storage.Blobs.Models.BlobErrorCode contains BlobAccessTierNotSupportedForAccountType
Actual behavior
Azure.Storage.Blobs.Models.BlobErrorCode doesn't contain BlobAccessTierNotSupportedForAccountType
Reproduction Steps
Run the following code with a custom file path and source data (or stream) and observe that the request fails with a RequestFailedException and the error code BlobAccessTierNotSupportedForAccountType.
Environment
No response