// todo make overloads to simplify the common case public static IGlobalConfiguration <AzureJobStorage> UseAzureStorage(this IGlobalConfiguration configuration, AzureStorageOptions options) { var storage = new AzureJobStorage(options); return(configuration.UseStorage(storage)); }
public AzureJobStorage(AzureStorageOptions options) { _options = options; _cosmosAccount = CloudStorageAccount.Parse(options.ConnectionString); _account = Microsoft.Azure.Storage.CloudStorageAccount.Parse(options.ConnectionString); _tableClient = _cosmosAccount.CreateCloudTableClient(); _blobClient = _account.CreateCloudBlobClient(); _queueClient = _account.CreateCloudQueueClient(); // ensure the required tables / containers exists GetTable(SERVER_TABLE).CreateIfNotExists(); GetTable(SETS_TABLE).CreateIfNotExists(); GetTable(LISTS_TABLE).CreateIfNotExists(); GetTable(JOBS_TABLE).CreateIfNotExists(); GetTable(HASHS_TABLE).CreateIfNotExists(); GetTable(COUNTERS_TABLE).CreateIfNotExists(); GetContainer(JOB_CONTAINER).CreateIfNotExists(); }