none
Azure Storage Client (v2.0) - Disposing resources...

    Question

  • What are the suggest best practices around disposing resources when working with Blob storage particularly with Managed client APIs ver 2.0 ?

    None of the following components implement IDispoable (or a Close() method).

    1. CloudStorageAccount
    2. CloudBlobClient
    3. CloudBlobContainer
    4. CloudBlockBlob

    Short of reviewing the source, where can I learn more about best practices around releasing resources?

    Thx in adv

      

     

    Wednesday, October 31, 2012 9:47 PM

Answers

  • Hi,

    those resources are released automatically by the storage client library, because they're created by the library. For example, using Reflector to review the code, you may notice:
    executionState.RestCMD.ResponseStream.Dispose();
    And:
    executionState.Resp.Close();
    When designing your own class library, it is also a good idea to dispose the resources you created (but not resources created by the caller).

    Best Regards

    Monday, November 5, 2012 9:39 AM
    Moderator

All replies