azure-table-storage

Azure Table Storage: How can I create a dynamic where clause?

依然范特西╮ 提交于 2019-12-08 02:51:10
问题 Ok, so I am using Azure Table Storage for the first time in a ASP.NET MVC 3 application. I have a table entity that has a user ID as its RowKey. I have a list of user IDs and need to get all of the entities that have one of the User IDs. In traditional SQL it would be a simple OR statement in the where clause that you can dynamically add to: select * from blah where userID = '123' or userID = '456' or userID = '789' but I haven't found the equivalent in the Azure SDK. Is this possible with

Generic code for handling Azure Tables concurrency conflicts?

跟風遠走 提交于 2019-12-07 18:16:12
问题 I'm looking at doing some updates into Azure Storage Tables. I want to use the optimistic concurrency mechanism properly. It seems like you'd need to do something like: Load row to update, possibly retrying failures Apply updates to row Save row, possibly retrying network errors If there is a concurrency conflict, reload the data (possibly retrying failures) and attempt to save again (possible retrying failures) Is there some generic class or code sample that handles this? I can code it up,

Delete Wildcard Row in Azure Table Without Query

泪湿孤枕 提交于 2019-12-07 17:13:56
问题 Is there a simple way to delete rows in Azure Table Storage without Query, for example, if I want to delete any row that PartitionKey="A" without get all content back and delete one by one. 回答1: The REST API supports this (using If-Match:*): http://msdn.microsoft.com/en-us/library/dd135727.aspx Not sure the managed API supports this. You might be able to "trick" the managed API by registering a SendRequestEvent handler (http://msdn.microsoft.com/en-us/library/system.data.services.client

Requeue or delete messages in Azure Storage Queues via WebJobs

最后都变了- 提交于 2019-12-07 16:31:24
问题 I was hoping if someone can clarify a few things regarding Azure Storage Queues and their interaction with WebJobs: To perform recurring background tasks (i.e. add to queue once, then repeat at set intervals), is there a way to update the same message delivered in the QueueTrigger function so that its lease (visibility) can be extended as a way to requeue and avoid expiry? With the above-mentioned pattern for recurring background jobs, I'm also trying to figure out a way to delete/expire a

Create Directory Hierarchy Structure in Azure Tables Storage

喜你入骨 提交于 2019-12-07 12:05:20
问题 Is it possible to create a directory like structure in Azure Tables? I need to store some metadata in a tree like structure. For example if I have 10 items and each item contains some metadata columns (there are some common columns for all of them [id, name, date created, author ... ], but might be also some columns that one item might have but another one no) Can these items be stored in a structural way? Item1 |_____ Item2 |_____ Item3 |_____ ItemX 回答1: You can't nest the way you describe,

Azure Table Storage best practice for ASP.NET MVC/WebApi

可紊 提交于 2019-12-07 09:40:25
问题 What are the best practices for connecting to a Azure Table Storage from a ASP.NET MVC or Web API app? Right now I've made a StorageContext class which holds a reference to the CloudStorageAccount and CloudTableClient , like this: public class StorageContext { private static CloudStorageAccount _storageAccount; private static CloudTableClient _tableClient; public StorageContext() : this("StorageConnectionString") { } public StorageContext(string connectionString) { if (_storageAccount == null

Azure CloubdBlob's Properties.Length returns 0

怎甘沉沦 提交于 2019-12-07 08:17:16
问题 The following code returns blob file size of 0: public long GetFileSize(string fileUrl) { var blob = GetBlobContainer().GetBlobReference(fileUrl); return blob == null ? 0 : blob.Properties.Length; } , its almost as it does not find the blob. But of I delete the blob I see that it gets deleted. This works when deleting: void DeleteFileFromBlob(string fileUrl, bool deleteSnapshots) { var blob = GetBlobContainer().GetBlobReference(fileUrl); if (deleteSnapshots) { var options = new

Non-derived POCO and Azure Storage

北战南征 提交于 2019-12-07 02:32:15
问题 Is it possible to have a non-derived POCO for Azure Table Storage? In other words, a POCO that does not derive from TableEntity or implement ITableEntity ? It seems a step backward to have to have a model which is dependent on the interface or base class, as this causes reference leaks upward in the chain - I cannot set up the model in another tier without it having to know about Azure Storage for either the interface or the base class! 回答1: Take a look at DynamicTableEntity (ctrl+f for it).

How can I store arbitrary key value pairs in Azure table storage?

落花浮王杯 提交于 2019-12-07 02:24:22
问题 Background I am receiving CSV data files from clients that contain a large amount of data that I don't need and a small amount of data that I do. In the future I may need to access that data and although I'm archiving the original data files I was hoping for something a bit easier to query. I was hoping for a solution that didn't mean the data files stayed in the same format - i.e. the client may add/remove columns and I don't want my implementation to bail on missing data or fail to archive

Azure table storage error: “Unexpected response code for operation : 99”

北城以北 提交于 2019-12-07 01:35:16
问题 I got this error when I executed the following code: var insert = new TableBatchOperation(); foreach (var entity in entities) { insert.Insert(entity); } cloudTable.ExecuteBatch(insert); Where the entities collection contained 512 elements. The Azure SDK through a StorageException: "Unexpected response code for operation : 99" What does this error mean, and how can I solve this? 回答1: This un-descriptive error means that Azure bulk operations (at least in this case) takes up to 100 elements .