How to programatically know if an Azure Storage Table has changed? - azure

I was wondering if there is any way to programatically know if a table in Azure Table Storage has changed and then what has changed in the table?

No, not really. Your only option would be to go through all records in the table and see if the record changed based on the Timestamp property (even though the official documentation advises you not to read the Timestamp property).
Or have your code do the tracking each time an entity is added/updated/removed by writing this to an other table (an audit table).

Related

Azure Storage Table get latest row ADF

I have created a azure storage table and I need to get the last inserted row. I have tried using a filter with something like #equals(int(formatDateTime(item().date,'yyMMddHHmmss')),max(int(formatDateTime(item().date,'yyMMddHHmmss'))))
I am open to any ideas
If you are trying with ADF, kindly note that max() is not supported for azure table storage as specified in this MS Doc of Table Service Query Operators.
Two of the methods for getting the latest entry/row is using the date-time. For example, DateTime.MaxValue.Ticks - DateTime.UtcNow.Ticks
This is not good practice if the order is random based on the rowkey.
Another approach is using the Timestamp:
results.OrderByDescending(r => r.Timestamp).FirstOrDefault();
Refer to the SO Thread 1 & 2 for more information.

Track Deletion with combined index Azure Cognitive Search

I have a combined index that crawls data from Azure SQL and Blob and are mapped based a common column.
The mapped blob document is optional.
When there is no blob document the search indexer indexes the respective SQL row setting the content propertyas null and if the document is available the content property shows correct data.
I have enabled BLOB deletion tracking and the issue comes when a blob document is deleted. The deletion policy triggers and also removes the mapped SQL row values from index.
I was expecting that the content property will be set to null, but the deletion policy also removes the mapped SQL row values from index.
What am I doing wrong? Kindly help.
Thanks a lot in advance..
BR
The behavior you are seeing is by default. SQL Deletion Policy deletes full index documents based on their document Key, not specific fields. The policy doesn't have a way to know the index has values from other sources too. If there is a combined index and you would like the behavior you are looking for, you may try instead using a Logic App SQL trigger to update only specific fields with Add, update or delete documents, instead of the Deletion Policy.

Query to update a table contents in azure table storage

Is it possible to update a column using Query in azure table storage ? The table has already 100 records and now I have added a new column. For the previous 100 records , the newly added column value is "null" as shown in the image. I just want to set a default value for all the 100 records. I need to know how to update the table.
There are several ways to edit columns in Azure storage, you can use the Update Entity functionality to do via Web requests, I'd recommend checking the documentation, Then you can also use Storage Explorer to modify single columns if you have enough permissions.

Trigger Azure Function with Filtered Document Type from CosmosDB Collection

Can we we trigger an azure function only when certain document with field values inserted into Cosmos DB ? E.G an employee document with country "USA" field value trigger azure function. I couldn't figure this one out as its always triggering the function whenever there is an item added / modified which makes too much function calls.
Thanks !
Regards,
Sowmyan
Well based on the suggestion from one of the cosmosdb expert from microsoft
"Right now we don't support filters on the Change Feed but it is in
the roadmap :) You can apply a filter within the Function's code as a
workaround right now on the batch of received documents."
You can do the above rather than partitioning which is going to cost you much.
the trigger doesn't seem to have any way to filter based on field value, but you can always partition your data into different collections if that makes sense for your case

How to create a unique property in Azure Table Storage

In azure table storage is it possible to add a unique constraint on a column of a given table?
Azure Table Storage entities don't have columns. Each entity may have properties and these properties don't need to be the same for each entity.
The only unique constraint is the combination of partition key + row key.
There's an excellent article on Azure table storage here:
http://msdn.microsoft.com/en-us/library/windowsazure/dd179338.aspx
Since it only has a Row Key and a Partition Key, and the Row Key is essentially the primary key, it doesn't look like there's any other constraint you can put on it unless you build that sort of thing into your client/server which uses or exposes it.
From the article:
The Table service does not enforce any schema for tables, so two entities in the same table may have different sets of properties. Developers may choose to enforce a schema on the client side. A table may contain any number of entities.
HTH :)

Resources