public AzureBlobSnapshotStore(Config config = null)
        {
            _serialization = new SerializationHelper(Context.System);
            _settings      = config is null
                ? AzurePersistence.Get(Context.System).BlobSettings
                : AzureBlobSnapshotStoreSettings.Create(config);

            if (_settings.Development)
            {
                _serviceClient = new BlobServiceClient("UseDevelopmentStorage=true");
            }
            else
            {
                var credentialSetup = Context.System.Settings.Setup.Get <AzureBlobSnapshotSetup>();
                if (credentialSetup.HasValue)
                {
                    _serviceClient = new BlobServiceClient(
                        credentialSetup.Value.ServiceUri,
                        credentialSetup.Value.DefaultAzureCredential,
                        credentialSetup.Value.BlobClientOptions);
                }
                else
                {
                    _serviceClient = new BlobServiceClient(_settings.ConnectionString);
                }
            }

            _containerClient = new Lazy <BlobContainerClient>(() => InitCloudStorage(5).Result);
        }
Beispiel #2
0
        public AzureBlobSnapshotStore()
        {
            _settings       = AzurePersistence.Get(Context.System).BlobSettings;
            _serialization  = new SerializationHelper(Context.System);
            _storageAccount = CloudStorageAccount.Parse(_settings.ConnectionString);

            _container = new Lazy <CloudBlobContainer>(() => InitCloudStorage().Result);
        }
Beispiel #3
0
 private static BlobRequestOptions GenerateOptions(AzureBlobSnapshotStoreSettings settings)
 {
     return(new BlobRequestOptions {
         MaximumExecutionTime = settings.RequestTimeout
     });
 }