Pooh
Pooh

Reputation: 41

I need to append logs to Auditlog.csv file in blob storage of DataLake Gen 2 from C#

var sa = CloudStorageAccount.Parse(connection string);
var blobClient = sa.CreateCloudBlobClient();
string filename = "appendlogs.txt";
CloudAppendBlob appBlob1 = container.GetAppendBlobReference(filename);
if (!appBlob.Exists())
{
    appBlob.CreateOrReplace();
}

I am getting the error "The remote server returned an error: (409) Conflict." while executing the line appBlob.CreateorReplace()

Please help how should I go about this and after creating this append blob how should I append it to my csv file.

Upvotes: 0

Views: 842

Answers (1)

Gaurav Mantri
Gaurav Mantri

Reputation: 136336

I believe the reason you're getting this error is because your storage account has Data Lake Gen2 (Hierarchical namespace) enabled and Append Blobs are not supported there (at least as of now).

When I tried to create an append blob in such an account (using Node API BTW), I got the following error message:

{
    "name": "StorageError",
    "message": "Specified feature is not yet supported for hierarchical namespace accounts.\nRequestId:xxxx\nTime:2020-02-02T05:57:13.7882503Z",
    "code": "FeatureNotYetSupportedForHierarchicalNamespaceAccounts",
    "featurename": "Append Blobs",
    "statusCode": 409,
    "requestId": "xxxx"
}

I saw the same behavior on Azure Portal as well.

Upvotes: 1

Related Questions