Currently, as far as I can tell, there is no way to close the sockets opened by azure.storage.blob.BlobServiceClient. The underlying PipelineClient has a close() method (plumbed all the way down to requests and urllib3), but there is no public way to reach it (including deleting the azure.storage.blob.BlobServiceClient object).
To call close on the underlying requests session, I've found I have to call: <BlobServiceClient>._client._client.close(). The <PipelineClient>.close() method should be propagated in the generated _azure_blob_storage.py and then adding close() to the StorageAccountHostsMixin would resolve this issue. Unfortunately, I can't submit a PR to do this, as I can't affect the generated code.
@timuralp thanks for reporting this! Someone from our team will look into this //cc: @rakshith91 @mayurid
@timuralp Thanks for reporting this. This is a valid concern. Working on generated code.
Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.
Resolved the issue.
@timuralp Thanks again for reporting.