Reputation: 2124
Can I somehow subscribe for notifications about Azure's blob object changes?
My purpose is to delegate file uploads to the client using SAS and lately (after upload is complete) update the database. It looks like I need to continuously check blob's state, but it is quite resource consuming process.
Upvotes: 7
Views: 5482
Reputation: 1526
You can now do this using Azure functions
Create a blob trigger by specifying your storage account connection string and your container/{name}
In outputs, select the place where you want your notification to go to
Upvotes: 4
Reputation: 34830
I created a file change monitor for monitoring blobs - full details at http://ben.onfabrik.com/posts/monitoring-files-in-azure-blob-storage
Upvotes: 3
Reputation: 60153
Another option to consider is to have the client notify you when it's done uploading.
Upvotes: 3
Reputation: 9255
You can't be notified by the Blob Storage about a change made to a blob, but as you point out, you can monitor it, requesting the ETag on a scheduled basis to see if it's done.
That being said, the cost to monitor a blob (or even a whole container) can be close to negligible if correctly implemented. Pinging the Blob Storage once per second costs you roughly $2.5 / month. Then, by using some heuristic you can probably lower this cost to $0.25 (one check per 10s on average). At this point, it's not really interesting to try to optimize more.
Upvotes: 11