/// <summary>
        /// Create stream processor
        /// </summary>
        /// <param name="config"></param>
        /// <param name="processor"></param>
        /// <param name="logger"></param>
        public BlobStreamProcessor(IBlobConfig config, IBlobProcessor processor,
                                   ILogger logger)
        {
            _logger    = logger ?? throw new ArgumentNullException(nameof(logger));
            _processor = processor ?? throw new ArgumentNullException(nameof(processor));
            var storageAccount = CloudStorageAccount.Parse(config.GetStorageConnString());

            _client  = storageAccount.CreateCloudBlobClient();
            _options = new BlobRequestOptions();
        }
Beispiel #2
0
        /// <summary>
        /// Get blob storage connection string
        /// </summary>
        /// <param name="config"></param>
        /// <returns></returns>
        public static string GetStorageConnString(this IBlobConfig config)
        {
            var account = config.AccountName;
            var key     = config.AccountKey;
            var suffix  = config.EndpointSuffix;

            if (string.IsNullOrEmpty(account) || string.IsNullOrEmpty(key))
            {
                return(null);
            }
            return(ConnectionString.CreateStorageConnectionString(
                       account, suffix, key, "https").ToString());
        }