Keep CloudBlobClient Throughout the Application Lifecycle with Dependency Injection

I want the nested container container CloudBlobContainer in the container to be added to my custom class.

The question is life time. I could do for Per Web Request or Singleton, because this client will never change when the application starts.

My question is should I expect problems because blobClient supports some kind of open connection?

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
ConfigurationManager.AppSettings["MyDataStorageConnectionString"]
);

CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("mydata");
+4
source share
1 answer

IIRC, Azure SDK - API, . Azure HTTP ( 2 REST), CloudBlobContainer doesn ' t .

CloudBlobContainer -.

, , , , , -.

+1

Source: https://habr.com/ru/post/1609937/


All Articles