Azure Storage Blob types (CloudBlobContainer, CloudBlobClient, etc.) and thread safety

前端 未结 1 1617
逝去的感伤
逝去的感伤 2021-01-12 07:27

I am developing an azure application which needs at some point to upload(download) a large amount of small blobs to a single container (more than 1k blobs, less than 1 Mb ea

1条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 08:17

    You should be fine sharing a single blob container reference as long as you are not trying to perform an update on the container itself (even then, I think it would still be fine in most scenarios like List). In fact, you don't really even need the container reference if you are sure it exists:

    client.GetContainerReference("foo").GetBlobReference("bar");
    client.GetBlobReference("foo/bar");  //same
    

    As you can see, the only reason to get a container reference is if you want to perform an operation on the container itself (list, delete, etc.). If you keep the blob references in separate threads, you will be fine.

    0 讨论(0)
提交回复
热议问题