开发者

Notification about azure blob object changes

开发者 https://www.devze.com 2023-04-12 10:17 出处:网络
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 complet开发者_如何转开发e) upd

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 complet开发者_如何转开发e) update the database. It looks like I need to continuously check blob's state, but it is quite resource consuming process.


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.


You can now do this using Azure functions

  1. Create a blob trigger by specifying your storage account connection string and your container/{name}

  2. In outputs, select the place where you want your notification to go to


Another option to consider is to have the client notify you when it's done uploading.


I created a file change monitor for monitoring blobs - full details at http://ben.onfabrik.com/posts/monitoring-files-in-azure-blob-storage

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号