c# - Update RowKey or PartitionKey in Azure Table Storage -
can update rowkey or partitionkey properties of entity in azure table storage?
i thought yes or maybe partitionkey trying that(try change rowkey or partitionkey) , error:
the remote server returned error: (404) not found. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.net.webexception: remote server returned error: (404) not found. source error: line 143: line 144: var updateoperation = tableoperation.replace(entity); line 145: _table.execute(updateoperation); line 146: } line 147: } my code update entity(short version):
var query = new tablequery<calculatoraccesstokenentity>() .where(tablequery.generatefiltercondition("accessurl", querycomparisons.equal, url)); var newtoken = getuniquekey(5);//get random string of length 5 entity.partitionkey = newtoken; // try use merge here unsuccessful var updateoperation = tableoperation.replace(entity); _table.execute(updateoperation);
no, can't update entity's partitionkey or rowkey. need perform 2 operations: first delete entity existing partitionkey/rowkey , insert new entity new partitionkey/rowkey.
Comments
Post a Comment