public AzureManager(string storageConnectionString, string containerName,
                            string physicalRootPath, bool useBlobListCache)
        {
            Assert.ArgumentNotNullOrEmpty(storageConnectionString, nameof(storageConnectionString));

            if (!CloudStorageAccount.TryParse(storageConnectionString, out CloudStorageAccount storageAccount))
            {
                throw new ArgumentException($"{nameof(storageConnectionString)} is not a valid connection string");
            }

            CloudBlobClient    cloudBlobClient    = storageAccount.CreateCloudBlobClient();
            CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference(containerName);

            if (!cloudBlobContainer.Exists())
            {
                throw new DataException($"${containerName} is not found");
            }

            this.cloudBlobContainer = cloudBlobContainer;
            this.azureProvider      = useBlobListCache
                ? (IAzureProvider) new CachedAzureProvider(cloudBlobContainer, physicalRootPath)
                : new AzureProvider(cloudBlobContainer);
        }
 public BlobStorageTools(IAzureProvider provider)
 {
     Provider = provider;
 }
Ejemplo n.º 3
0
 public ValuesController(IAzureProvider _azureProvider)
 {
     azureProvider = _azureProvider;
     azureProvider.Initialize();
 }